IRC channel logs
2021-08-20.log
back to list of logs
<apteryx>sneek: later tell maximed I used call/ec with a simple 'return' continuation that just (return #f) in the suspendable-port handler, and it worked! Thank you for the pointers (see: https://notabug.org/apteryx/mcron). <stis>Happy greetings guilers! <apteryx>everything is accessed by reference by default in Guile, for composite objects? <apteryx>like if I have record A, then do (let ((my-var (some-accessor A))) (set! my-var new-value)), it'd mutate the value returned by (some-accessor A) next time it's called, correct? <taylan>apteryx: no, that would only mutate the variable in the lexical scope <taylan>for the change to be visible, (some-accessor A) would have to return a mutable object (e.g. as a "box"), and you would have to mutate that object (e.g. with "box-set!") <taylan>or maybe there is a mutating counterpart to some-accessor, like some-mutator!, so you can just call (some-mutator! A new-value) <apteryx>the value I want to set! is the field of a srfi-9 record <maximed>(set-employee-age! fred +inf.0) (equal? (employee-age fred +inf.0) +inf.0) ; -> #t <apteryx>right, the problem with set-field is that I have to carry around the resulting updated record instance <apteryx>didn't setters came stock with srfi-9 <taylan>apteryx: the setter doesn't return a new record object, it changes the record object in-place <taylan>apteryx: assuming you're using srfi-9 <apteryx>yep, I realize we can define setters on srfi-9 records now, thanks to maximed <RhodiumToad>(there are only 6 paths specified by posix: /, /dev, /dev/null, /dev/tty, /dev/console, and /tmp) <RhodiumToad>however, it's required to be the first thing named "sh" on the list of directories returned by confstr(_CS_PATH) <RhodiumToad>(this is how e.g. Solaris got away with keeping an old non-posix shell as /bin/sh, they defined their _CS_PATH result as putting /usr/xpg4/bin first on the list)