ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
orivej has joined #picolisp
aw- has joined #picolisp
orivej has quit [Ping timeout: 248 seconds]
<aw-> tankfeeder: there's a lot of repeating code in that URL parser.. (link (list 'sym (pack (cut (min ....
<aw-> it can probably benefit from a bit of refactoring to make it shorter
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 248 seconds]
orivej has joined #picolisp
rob_w has joined #picolisp
rob_w has quit [Changing host]
rob_w has joined #picolisp
rob_w has quit [Client Quit]
rob_w has joined #picolisp
rob_w has quit [Changing host]
rob_w has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
<aw-> hi all
<Regenaxer> Hi aw-
aw- has quit [Ping timeout: 248 seconds]
aw- has joined #picolisp
<aw-> oh iwas disconnected
<aw-> Regenaxer: quick question about performance
<aw-> which do you think is better:
<aw-> (make (do 16 (link (get *Mylist (rand 1 36)))))
<aw-> or
<aw-> (mapcar '((N) (get *Mylist (rand 1 36))) (need 16))
<aw-> ugh.. now my messages are arriving late :\
<aw-> and out of order haha
<clacke[m]> need more speculative execution of messages
<Regenaxer> aw-, I would say the first one is better, but very little difference
<Regenaxer> btw, isn't such a function in @lib/simul.l?
<Regenaxer> 'samples'
<Regenaxer> assuming that 36 is the length of the list
<Regenaxer> In your second version the (need 16) is quite a waste, creating a list which is never used
<aw-> i see
<aw-> hmmm (samples) is a bit different
<Regenaxer> Yes, it takes 'Cnt' samples, so no item can appear twice, while this is possible in your version
<Regenaxer> Is 36 the length?
<aw-> yes 36 is the length of *Mylist
<Regenaxer> So you want items to appear repeatedly? Then your version is needed
<aw-> ok!
<Regenaxer> I just notice that bash completion for pil does not work any more
<Regenaxer> Does it work on your system?
<Regenaxer> I forgot the details, but it used to work under Debian
<Regenaxer> /etc/bash_completion.d/ is empty on my machine, so it seems I forgot something while installing
<Regenaxer> On an older server (jessie) it work
<Regenaxer> works
mtsd has joined #picolisp
<aw-> i don't use it
<aw-> i haven't gotten to it yet, sorry
<Regenaxer> It used always to work right out of the box
<Regenaxer> via apt install bash-completion
<aw-> yeah i read that a few days ago when i was asking about bash completion
<Regenaxer> Yes
<Regenaxer> I assumed it still worked ;)
<Regenaxer> Also on Termux it doesn't work any more :(
<Regenaxer> Really strange
<aw-> yes strange
<aw-> maybe it's because debian changed bash -> dash ?
<Regenaxer> Won't expect so
<aw-> i have a few scripts which were affected by that change
<aw-> bash scripts
<Regenaxer> You don't use #!/bin/bash ?
<aw-> ?
<aw-> what do you mean?
<aw-> i'm saying, previously /bin/bash was /bin/bash
<Regenaxer> Then scripts won't be affected if the default is dash
<aw-> but it was changed, /bin/bash -> /bin/dash
<aw-> it's a symlink to dash
<Regenaxer> oh
<Regenaxer> didn't notice
<aw-> and i have a bunch of scripts that failed because of that change
<aw-> because dash != bash
<Regenaxer> I have:
<Regenaxer> $ l /bin/bash
<Regenaxer> -rwxr-xr-x 1 root root 1.1M May 15 2017 /bin/bash*
<aw-> oh good
<aw-> so that's not the issue
<Regenaxer> Debian Buster
<Regenaxer> Maybe guru tankfeeder knows something about that?
<tankfeeder> no
<Regenaxer> ok
<Regenaxer> Hmm, seems a problem of the picolisp Debian package
<Regenaxer> /usr/lib/picolisp/lib/ does not contain complete.l any more
<Regenaxer> The maintainer somehow lost it it seems
<Regenaxer> ah, no
<Regenaxer> it *is* there, sorry
<Regenaxer> So only /etc/bash_completion.d/pil is missing
<Regenaxer> I ask the maintainer of the Debian package
<mtsd> Good morning all
<Regenaxer> Good morning mtsd
<mtsd> Good morning Regenaxer!
orivej has joined #picolisp
mtsd has quit [Ping timeout: 260 seconds]
aw- has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 265 seconds]
<beneroth> hi all
<Regenaxer> Hi beneroth
<tankfeeder> i want commit code for URL parsing to rosetta
<tankfeeder> i want it minimalistic and maybe supports only URL from task
<tankfeeder> this code works.
<tankfeeder> hints and ideas are welcome.
mtsd has joined #picolisp
<Regenaxer> Wouldn't 'split' be easier?
<Regenaxer> hmm, no
<Regenaxer> Using so much 'index' calls looks not so lispy
<tankfeeder> but i know then how long to cut
<Regenaxer> Wouldn't 'match' be better?
<Regenaxer> Let me try
<Regenaxer> I would start with (match '(@Scheme ":" "/" "/" @Domain "/" @Path "?" @Args) (chop Url))
<Regenaxer> Then operate on the parts?
<Regenaxer> (de url (Url)
<Regenaxer> (use (@Scheme @Domain @Path @Args)
<Regenaxer> (when
<Regenaxer> (match '(@Scheme ":" "/" "/" @Domain "/" @Path "?" @Args) (chop Url))
<Regenaxer> ...
<Regenaxer> ?
<tankfeeder> i will try
<Regenaxer> @Domain -> @Host perhaps
<Regenaxer> and then 'split' the parts on = & # etc.
<tankfeeder> split parts is not needed here
<tankfeeder> just a trivial idea-sceleton
<Regenaxer> great
orivej has joined #picolisp
aw- has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
<aw-> Regenaxer: looking at (align 'lst 'any)… is there an easy way to turn a list into 'any ? ex: (align (10 20) (fun Mylist))
<aw-> actually it's (align 'lst 'any ..)
<Regenaxer> ret
rob_w has quit [Quit: Leaving]
orivej has joined #picolisp
<Regenaxer> yes, 'pack' or 'glue' or so?
<aw-> doesn't work
<Regenaxer> What do you want to do?
<aw-> never mind, i found a diff approavh
<aw-> thanks
<Regenaxer> ok, but "doesn't work" is not possible
<Regenaxer> or, not acceptable
<Regenaxer> brb
<aw-> why? i wrote what I want to do: (align (10 20) (fun Mylist))
<aw-> (align (10 20) (pack Mylist)) does't work
<aw-> try:
<aw-> (prinl (align (10 20) "hello" "world"))
<aw-> (let Mylist '("hello" "world") (prinl (align (10 20) (pack Mylist))))
<beneroth> aw-, did you maybe meant (tab) instead of (align) ?
<Regenaxer> ret
<Regenaxer> I thought it depends on what 'fun' returns
<Regenaxer> (glue " " (fun Mylist)) or so
<Regenaxer> or, for your last example, it is a typical case for 'apply'
<Regenaxer> (apply align Mylist (10 20))
<Regenaxer> (apply align '("hello" "world") (10 20))
<Regenaxer> etc.
<aw-> ahhh
<aw-> (apply)
<aw-> i was looking at the problem incorrectly
<aw-> yes that makes sense
<Regenaxer> 'apply' is one of the fundamental Lisp workhorses
<aw-> i don't use it enough
<aw-> i need to hit the Lisp books once more it seems
mtsd has quit [Ping timeout: 260 seconds]
<aw-> thanks Regenaxer!
<Regenaxer> :)
rob_w has joined #picolisp
Regenaxer has quit [Ping timeout: 256 seconds]
aw- has quit [Quit: Leaving.]
Regenaxer has joined #picolisp
viaken has quit [*.net *.split]
michelp has quit [*.net *.split]
rick42 has quit [*.net *.split]
viaken has joined #picolisp
rick42 has joined #picolisp
michelp has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
<rick42> hello all!
<beneroth> hi rick42
<rick42> hey bene! o/
<beneroth> \o
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
f8l has quit [Remote host closed the connection]
f8l has joined #picolisp
rob_w has quit [Read error: Connection reset by peer]