IRC channel logs

2025-05-14.log

back to list of logs

<ArneBab>I use a run-<program>.scm script at top-level and foo/bar.scm for (foo bar), because the toplevel script adds the toplevel to the load path.
<ArneBab>⇒ -L "$(dirname "$(realpath "$0")")"
<old>ArneBab: I usually put the entrypoint under bin/
<old>or src/bin
<trannus_aran>wait, if goops methods don't support before/after/around qualifiers, how can one modify instance creation?
<trannus_aran>Like if I can (make <card> #:suit 'Diamonds #:rank 'Ace), how can I have a #:value slot that depends on the rank at construction?
<daviid>trannus_aran: you can define your own intialize method, and use get-keyword to make sure either initargs are 'complete' or raise an error ...
<daviid>trannus_aran: see https://www.gnu.org/software/guile/manual/html_node/Instance-Creation-Protocol.html
<ArneBab>old: I want to make this usable for games and they should really have the binary at the toplevel (if not packaged).
<wingo>rlb: it occurs to me that this is buggy: https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/symbols.c#n192
<wingo>i.e. you can have a utf-8 sequence N bytes long that happens to match an interned latin1 symbol N characters long
<lechner>old / rlb / ArneBab / thanks!
<lechner>wingo / you are saying that the two bytevectors have the same length but not the same contents? what does scm_i_is_narrow_symbol do?
<wingo>it is related to strings being either latin1 or utf32
<rlb>wingo: agree - if you were going to do that, it'd need to be scm_i_is_ascii..., not narrow, which I suppose might be worth the extra scan.
<rlb>lechner: it's because all byte sequences are valid latin-1 strings, so any utf-8 bytes are also a valid latin-1 string, just not the same string unless all the chars are ascii.
<rlb>i.e. ascii "bytes" are a subset of both latin-1 and utf-8.