karswell has joined #picolisp
orivej has joined #picolisp
f8l has quit [Ping timeout: 248 seconds]
f8l has joined #picolisp
karswell has quit [Read error: No route to host]
groovy2shoes has quit [Ping timeout: 252 seconds]
groovy2shoes has joined #picolisp
Regenaxer has left #picolisp [#picolisp]
Regenaxer has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
groovy2shoes has quit [Ping timeout: 276 seconds]
raydeejay has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
aw- has joined #picolisp
<
aw->
i was working on something and ran into a small issue
<
aw->
when I do for example: (in (list 'cat "*") … ) the "*" is not expanded.. bash typically performs glob expansion
<
aw->
how can I do that in pil ?
<
Regenaxer>
With (dir)
<
Regenaxer>
(for F (dir) (in F ..
<
Regenaxer>
And perhaps (for F (filter '((F) ...) (dir)) (in F ..
<
aw->
ahh.. ok that's what i thought
<
aw->
but that's not what i want
<
aw->
in this case it will run my command N number of times
<
aw->
i only want to run it once
<
Regenaxer>
Also no problem
<
Regenaxer>
you 'apply' it or so
<
aw->
'cat' was just an example.. but many programs accept multiple filenames as parameters
<
Regenaxer>
or just cons
<
Regenaxer>
(in (cons "command" (dir))
<
Regenaxer>
'apply' would make sense with 'call'
<
Regenaxer>
(apply call (dir) "command")
<
aw->
i thought apply executes 'call on every item in (dir)
<
aw->
so it's equivalent to (call "command" "file1" "file2" "fileN") ?
<
Regenaxer>
But for 'in' this is not needed
<
aw->
interesting..
<
Regenaxer>
we need only ("command" "file1" "file2" "fileN") as first arg
<
aw->
why does (in (cons "command"… i've never tried this
<
aw->
why wouldn't (in (list "command" (dir)) work ?
<
Regenaxer>
it give ("command" ("file1" "file2" "fileN"))
<
Regenaxer>
not what makes sense here
<
aw->
you're right!
<
aw->
which one is more efficient?
<
aw->
with (apply) or with (cons) ?
<
Regenaxer>
apply cannot be used here
<
Regenaxer>
with 'in'
<
Regenaxer>
or do you mean 'call'?
<
aw->
(apply call ..) or (in (cons ...
<
Regenaxer>
'in' involves no Lisp function, so 'apply' cannot be used
<
Regenaxer>
'call' is a (built-in) Lisp function
<
aw->
(in (cons … allows me to work with the result
<
Regenaxer>
'call' is only good for the side-effect
<
aw->
this is so good, i need to write this in my notes because i've encountered this issue a few times
<
Regenaxer>
good :)
<
aw->
are you working on Saturday too?
<
aw->
or just hacking as usual?
<
Regenaxer>
haha, no
<
Regenaxer>
I'm reading a book
<
Regenaxer>
Though I did some work in the morning
<
Regenaxer>
maintenance, backups, and one installation
<
Regenaxer>
Things to do when people don't work on the servers
<
Regenaxer>
My tablet beeps if something happens here in IRC ;)
<
aw->
oh i see, ok well enjoy the rest of your day. I'll be back tomorrow sometime
<
Regenaxer>
Sleep well!
aw- has quit [Quit: Leaving.]
orivej has joined #picolisp
<
cess11>
Did a shell oneliner earlier today, picolisp really excels at this.
<
cess11>
Apropos the log.
<
cess11>
Could be more general and use piping instead, of course.
<
Regenaxer>
You could save one 'and' in both cases
<
Regenaxer>
(match '(@A ~(chop (cadddr Lst))) (chop X))
<
Regenaxer>
(out "sh.sh"
<
Regenaxer>
(match '(@A ~(chop (cadddr Lst))) (chop X))
<
Regenaxer>
(out "sh.sh"
<
cess11>
It's for structure and making
<
Regenaxer>
ok, no big issue anyway
<
cess11>
sure it breaks if something goes wrong.
<
tankfeeder>
next task:
<
cess11>
I think it could be solved with 'cond as well as 'match.
orivej has quit [Ping timeout: 240 seconds]
groovy2shoes has joined #picolisp
C-Keen has quit [Quit: WeeChat 1.9.1]
Regenaxer has quit [Ping timeout: 248 seconds]
orivej has joined #picolisp
Regenaxer has joined #picolisp
C-Keen has joined #picolisp