00:17
beneroth has quit [Read error: Connection reset by peer]
00:17
beneroth has joined #picolisp
01:01
ygrek has joined #picolisp
02:02
alexshe80 has quit [Read error: Connection reset by peer]
03:48
ygrek has quit [Remote host closed the connection]
03:53
alexshendi has joined #picolisp
03:58
geri has joined #picolisp
04:01
<
geri >
judge me harshly (but not too harshly!)
04:01
<
geri >
still gotta think how do i replace $HOME with ~ prettily in subproject
04:11
<
geri >
i know that `(not *Dbg) is a bit faster cause it reads as an eof but its prettier like that with not that big of an impact
04:31
<
abu[7] >
The issue is not about being faster, but reading symbols which might otherwise pollute the namespace (e.g. if the rest of the file has (de debugFuns ...
04:41
alexshendi has quit [Ping timeout: 258 seconds]
04:43
<
geri >
well, that's not a problem here cause it just runs the thing and bye's
04:44
<
abu[7] >
Yes, just for the records
04:44
<
geri >
any idea how do i substitute $HOME for ~ optionaly in subproject function?
04:45
<
abu[7] >
You want to avoid ~ hardcoded in the pathes?
04:47
<
abu[7] >
How about using 'chdir'?
05:20
<
geri >
no, (ls) prints full paths to the files, i want to grab stdout and replace all instances of /home/geri with ~
05:21
<
geri >
i do want to unhardcode ~, but that's a. later and b. supposed to link to stuff like $XDG_CONFIG_HOME and the rest
05:21
<
geri >
and c. maybe i wont do cause its very ugly
05:25
<
abu[7] >
Vip does that
05:26
<
abu[7] >
iirc makes relative pathes whenever possible, forgot the details
05:27
<
abu[7] >
vip~fName ?
05:29
<
geri >
(prinl "/home/geri/hello.txt")
05:29
<
geri >
(out '("sed" "s#/home/geri#~#")
05:29
<
geri >
well this kinda seems to work
05:29
<
abu[7] >
sed is a bit overkill
05:29
<
geri >
i have a lot of lines to process
05:30
<
geri >
at least 111
05:30
<
abu[7] >
just chop and nth with length of HOME
05:30
<
geri >
wont it be slower though?
05:31
<
abu[7] >
A forked process is a lot slower
05:31
<
geri >
okay, lets see
05:35
<
geri >
(de subproject-pretty (Name)
05:35
<
geri >
(subproject Name)
05:35
<
geri >
(while (line T)
05:35
<
geri >
(prinl "~" (nth (chop @) `(inc (length HOME)))))))
05:35
<
geri >
now to "benchmark"
05:37
<
geri >
0.018-0.034s for sed, 0.016-0.034s for while read
05:38
alexshendi has joined #picolisp
05:38
<
abu[7] >
I meant 'pipe' vs. 'nth'
05:39
<
geri >
ls returns stdout
05:39
<
geri >
thats why pipe
05:39
<
geri >
(except i didnt get it anyway i think)
05:39
<
abu[7] >
Seems I misunderstood what you want to do
05:40
<
geri >
grab all stdout generated by git + prinl and switch $HOME to ~
05:41
<
geri >
i use subproject subcommand in emacs to quickly jump to files in my configs and termux has $HOME be billion characters long
05:41
<
geri >
hence the ~ replacement
05:42
<
abu[7] >
(pack (nth (chop (path File)) (length HOME))) or similar
05:42
<
abu[7] >
Perhaps also 'realpath'
05:43
<
abu[7] >
like ie vip~fName
05:43
<
geri >
well, it works and is similar-ish way already, just grabbing stdout first
05:43
<
geri >
so i guess question resolved xd
05:43
<
abu[7] >
OK, if speed is not an issue
05:44
<
geri >
not an issue but is nice to have
05:46
<
geri >
basically, (subproject) returns stdout - paths to files that are related to a particular thing, like emacs or my scripts
05:46
<
geri >
and subproject-pretty should just substitute $HOME in stdout to be a tilde instead
05:47
<
geri >
idk if theres anything else i could optimize there
05:48
<
abu[7] >
(let Path (or Path HOME) could be (default Path HOME)
05:48
<
abu[7] >
avoiding a bind with 'let'
05:49
<
geri >
less indentation, nice
05:50
<
geri >
i even use backquote whenever calculating constants!
05:50
<
geri >
its such a nice feature
05:50
<
abu[7] >
if `*Dbg, the whole (de main ..) can be avoided
05:51
<
geri >
its useful for debugging if something in my case statement is broken
05:52
<
abu[7] >
switching on *Dbg later?
05:52
<
geri >
no like the (case (arg 1) ...) part
05:53
<
abu[7] >
Then *Dbg is off and main is there
05:53
<
abu[7] >
I meant `(not *Dbg) of course
05:53
<
geri >
for some reason i have "git" as a case option in there xd
05:53
<
geri >
main is always there, yeah
05:53
<
geri >
if im not debugging its getting called and script dies
05:54
<
geri >
if im debugging its there for me to debug
05:55
<
geri >
i like the alist with subproject files that resolves properly
05:57
<
abu[7] >
(cdr (assoc Name Subpr... could be (get Name Subpr...
05:57
<
abu[7] >
is also faster
05:58
<
geri >
i was confused about it at some point when writing a lisp interpreter in pil :D
05:58
<
abu[7] >
Works because the keys are internals
05:58
<
abu[7] >
ie. 'asoq'
05:58
<
geri >
actually it returns nothing for some reason
05:59
<
abu[7] >
Must go ...
06:00
<
abu[7] >
Yes, cu :)
08:22
geri has quit [Remote host closed the connection]
09:00
alexshendi has quit [Quit: -a- Connection Timed Out]
09:30
alexshendi has joined #picolisp
09:43
alexshendi has quit [Read error: Connection reset by peer]
09:44
alexshendi has joined #picolisp
10:37
alexshendi has quit [Read error: Connection reset by peer]
10:37
alexshendi has joined #picolisp
11:09
rob_w has joined #picolisp
11:13
f8l has joined #picolisp
11:31
alexshe46 has joined #picolisp
11:32
alexshendi has quit [Ping timeout: 252 seconds]
13:07
ygrek has joined #picolisp
13:10
ygrek has quit [Remote host closed the connection]
13:46
ygrek has joined #picolisp
14:28
ygrek has quit [Ping timeout: 260 seconds]
14:42
taleon has quit [Ping timeout: 252 seconds]
14:42
taleon has joined #picolisp
16:09
alexshe46 has quit [Ping timeout: 260 seconds]
18:31
f8l has quit [Ping timeout: 255 seconds]
22:51
rob_w has quit [Quit: Leaving]
23:56
lagash has quit [Remote host closed the connection]
23:56
lagash has joined #picolisp