beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
aw- has quit [Ping timeout: 248 seconds]
aw- has joined #picolisp
aw- has quit [Ping timeout: 252 seconds]
aw- has joined #picolisp
corecheckno has quit [*.net *.split]
mario-goulart has quit [*.net *.split]
mario-goulart has joined #picolisp
user3456 has quit [Read error: Connection reset by peer]
user3456 has joined #picolisp
rob_w has joined #picolisp
<viaken> I think I don't understand dynamic scope, or how (let) works. Why is Guard keeping its rotation in subsequent calls of my (solve-1) here? (Advent of Code spoilers) https://git.sr.ht/~dpflug/advent/tree/trunk/item/2024/6.l#L27
<abu[7]> Guard is a "free" variable in drawOnFloor
<abu[7]> It is "bound" dynamically in solve-1
<abu[7]> 'let' saves the values of the symbol(s) in a stack frame and sets new values
<abu[7]> All code (no matter where) that accesses these symbols during that *time* sees these values
<abu[7]> '() is a bit redundant
<abu[7]> NIL is enough ;)
<abu[7]> Like "(let (Out '()) ..." should be "(let Out NIL ..."
<abu[7]> (I'm too pedantic about code size ;)
<viaken> Ah, of course.
<abu[7]> The whole .. (queue 'Out .. (pack Out) can in newer pil's be replaced with (pack (make (output (link @@) ...
<abu[7]> But as the result of (drawOnFloor) seems to be not used, the whole packing can be left out, no?
<viaken> Yep. I'm still vague on the various styles of printing.
<abu[7]> good
<viaken> The larger inefficiency is that I'm storing visits twice when printing, but I'll get that later when refactoring for part 2.
<viaken> Thank you for the tips!
<abu[7]> ☺
ygrek has joined #picolisp
bjorkintosh has quit [Remote host closed the connection]
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
bjorkintosh has joined #picolisp
bjorkintosh has joined #picolisp
theruran has quit [Quit: Connection closed for inactivity]
corecheckno has joined #picolisp
rob_w has quit [Read error: Connection reset by peer]
ygrek has quit [Remote host closed the connection]