IRC channel logs

2023-12-16.log

back to list of logs

<cow_2001>apteryx: i wrote two SRFI package definitions (133 and 232) for Guix: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67847 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67760
<apteryx>cow_2001: great! I'll try to review these
<apteryx>did you try the snarfi thing I posted on guile-devel to import the SRFIs spec text into Texinfo?
<apteryx>yay, successfully completed a guile-hall powered project, resulting in a few fixes/improvements to guile-hall itself
<sailorCat>Hi, could you please explain me why the semantic of the set! and set-car! forms behave differently inside a function definition. For instance if I define a function like `(define (fn-set2! var val) (set-car! var val) var)` it works as expected, I can use it like `(define y '(1 2 3)) (fn-set2! y 14)` and then y is equal `(14 2 3)`. But with `(define (fn-set! var val) (set! var val) var)` it definitely create another binding within the
<sailorCat>function, so `(define x 4) (fn-set! x 2)` will return 2, but then x still equal 4. What's the logic behind this behavior?
<isaneran>good day guilers!
<dsmith>sailorCat, Functions are applied to values, not locations.
<dsmith>When you call fn-set! You it is basically (fn-set! 4 2)
<dsmith>s/You it/It/
<dsmith>sailorCat, to do what you want fn-set! would need to be a macro, to not evaluate the arg
<mwette>sailorCat: or pass via boxes; see (srfi srfi-111) or (ice-9 atomic)
<mwette>but macro is probably what you want
<dsmith>sailorCat, Also, set! is a special form, while set-car! is not.
<cow_2001>regarding haunt's site procedure and its #:domain keyword - what if the root of the site will sit not in example.com/, but in example.com/haunt-site/?
<sailorCat>thanks, it has a sense
<mirai>is there a way to run a guile script “line-by-line” (e.g. <https://paste.centos.org/view/85d89123>) and get the kind of output I'd get by pasting the lines in the repl?