IRC channel logs

2021-01-16.log

back to list of logs

***cbaines_ is now known as cbaines
<rekado>ArneBab: it seems that I can break wisp by (read-set! keywords 'prefix)
<rekado>“let\n : hello” is read as “let #:hello”
<jgart>Hello! `local-file` is a record that is then shadowed by the macro local-file (using define-syntax). Is my thinking correct on that? I'm reading the code in this file: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/gexp.scm#n406
<sneek>Welcome back jgart, you have 1 message!
<sneek>jgart, leoprikler says: (system vm disassembler)
<leoprikler>now that's an old message
<jgart>macro local-file https://git.savannah.gnu.org/cgit/guix.git/tree/guix/gexp.scm#n445
<leoprikler>jgart, the record is called <local-file>
<leoprikler>and the constructor for it is %%local-file, because it has both %local-file and local-file as sugar
<jgart>so in this example the macro local-file is being called? https://paste.debian.net/1181323/
<rlb>do we not provide a (documented/supported) function equivalent to the repl ,time? i.e. so you can use it from casual benchmark programs? If not, wondering if we might want to.
<spk121>rlb: i use the 'times' procedure for casual benchmarking. You can difference the output of 'times' before and after
<Bumblehorse>Is there a simple way to make the full pathname of guile in a script portable?
<RhodiumToad>there's the usual trick with /usr/bin/env
<Bumblehorse>Wow... I didn't know about that
<Bumblehorse>Is this why guix has env in /usr/bin?
***rekado_ is now known as rekado
<rekado>ArneBab: the problem with prefix keywords is with “read” itself, not with the wisp reader. (call-with-input-string ": hello" read) results in “#:hello”, so if wisp wanted to support prefix keywords it couldn’t use read for them.
<RhodiumToad>allowing spaces between the : and the name in prefix keywords seems ... surprising, and arguably a bug in itself
<rekado>yes, I submitted a bug report
<ArneBab>rekado: thank you for the info! This hack "foo" → (identity "foo") has been done in readable, but it results in lots of problems down the line, because you now need syntax to specify that you actually want to call something, so you start adding parens about the newline call
<ArneBab>rekado: there is one thing so: In discussions about getting wisp-derived syntax into racket, there was the proposal to use .. instead of . as line-prefix, which is much more visible while being consistent with ++ being the vector-equivalent of + (so .. would be the list-equivalent of .)
<ArneBab>rekado: what are prefix-keywords?
<ArneBab>rekado: in readable they added newline() for the no-arguments use-case which is only ever required because they interpret single-element lines as "no function application"
<ArneBab>rekado: do you use wisp-mode? It’s highlighting should already help a lot in avoiding the missing . problem (because then the first element gets highlighted as procedure)
<rekado>ArneBab: is there ever a case where one would *want* to apply a string literal, though?
<rekado>a prefix keyword looks ilke this: “:hello”
<ArneBab>in macros you might want to give it as first element
<ArneBab>ah, prefix is like common-lisp keywords then
<rekado>but wouldn’t the macro have to appear first right after indentation?
<ArneBab>when you’re in alists that can happen, too
<ArneBab>list ("foo" . "bar")
<rekado>how would I write this with "foo" appearing as the first thing after indentation, though?
<ArneBab>in macros you sometimes assemble list elements one by one
<ArneBab>list\n "foo" . "bar"
<ArneBab>quote\n "foo" . "bar"
<ArneBab>(sorry)
<ArneBab>list evaluates the content, but quote does not
<rekado>ah, I didn’t realize this was possible. I assumed that in Wisp *anything* appearing first after indent would become an application of that thing to the rest of the line.
<rekado>but I see now that (quote ("foo")) is perfectly fine.
*rekado has to leave for a while
<ArneBab>That’s the result of building wisp as a general syntax for a language as powerful as Scheme :-)
<rekado>ArneBab: I do use wisp-mode but it does not change the color of strings that appear in the first position.
<rekado>I regularly forget about the leading dot when splitting string-append expressions
***Fulax` is now known as Fulax
<ArneBab>rekado: ah, I see the problem …
<ArneBab>should have initial-element be the stronger fontification than string
***roptat_ is now known as roptat
<civodul>hey ho!
<civodul>wingo: i get suspicious unbound-variable warnings with 3.0.5
<civodul>namely, when using a macro from (foo) that expands to a reference to a binding in (foo)
<civodul>for example, "unbound variable `make-compound-condition'" when using 'condition' from (srfi srfi-35)
<civodul>does that ring a bell?
<rlb>wingo: on an unrelated note, I'm not sure, but it looks like fector might have a bug when popping, i.e. https://paste.debian.net/hidden/a3e4bb71/ The ref at the end there, returns te internal structure, rather than the value.
<rlb>(Revealed by some of the lokke vector tests, fwiw...)
*rlb was attempting to compare the performance against what we already have...
<rlb>Is there a generally preferred way to handle implementation-specific bindings that need to be shared between two modules? i.e. they're considered "private", but of course can't actually be private.
<rlb>e.g. a shared (foo internal bar) module, or symbols prefixed with % or sneaking around via @@ or...
<civodul>rlb: hey! i recommend against @@: that may not work with declarative modules
<civodul>a (foo internal) module sounds good to me
<rlb>heh, yeah, I figured that was the least likely :)
<rlb>@@ I mean
<civodul>yeah
<rlb>And OK, thanks.
<civodul>Fibers has such a module, for instance
<civodul>Guile-Gcrypt too
<civodul>we can almost see a pattern here :-)
<rlb>perfect
<apteryx>is it possible to control failure on redirect-port ?
<apteryx>I have it causing a script to exit with status 1, without apparently raising an exception whatsoever, nor exit code (as documented: the return value is unspecified). Still, there must be a way to prevent the script from exiting and report the problem?
<apteryx>haha, I'm just silly, and the actual error is probably logged in the file the port was redirected to ;-)
<apteryx>indeed
<leoprikler>Tsukundere is a very special case in that I selectively export "public" bindings only from (tsukundere).
<leoprikler>That being said, I couldn't resist having (tsukundere game internals) regardless :)
<apteryx>is there a default output port corresponding to /dev/null in Guile
<apteryx>ah, (%make-void-port mode)
<mfg>Hi, how do i capture the output of for example (remainder/ 13 5) in a single list?
<mfg>i meant (euclidean/ 13 5) not remainder :D
<pinoaffe>mfg: I'd do ((compose list euclidean/) 13 5)
<leoprikler>👆️
<mfg>pinoaffe: thx! i didn't know compose :-)
***civodul` is now known as civoudl
***civoudl is now known as civodul
<pinoaffe>mfg: compose it's great, it allows for simplifying some code a lot, and multiple values can improve this even more, I usually only ever use multiple values with compose
<pinoaffe>*is
<pinoaffe>I think the first time I used multiple values with compose was when I turned https://github.com/words/syllable/blob/master/index.js#L287 into https://gitlab.com/pinoaffe/guile-words/-/blob/master/words/syllables.scm#L318
<rlb>Hmm, interesting, I'm surprised compose works with multiple values (as an implicit adapter) like that.
<rlb>not unpleasantly, just surprised...
<rekado>pinoaffe: wow, I didn’t know compose handled multiple values! I’ll remember this the next time I’m annoyed by having to use call-with-values
<pinoaffe>happy to help!
<pinoaffe>I always thought that compose was the raison d'etre of multiple values :)