IRC channel logs

2025-01-27.log

back to list of logs

<ArneBab>ttz: did you already look at the r7rs benchmarks by ecraven? https://github.com/ecraven/r7rs-benchmarkshttps://ecraven.github.io/r7rs-benchmarks/
<jlicht>sneek: later tell dthompson: the support for publishers in haunt is _really_ nifty!
<sneek>Got it.
<ttz>Yes I did, what about it?
<wingo>o/
<sneek>wingo, you have 1 message!
<sneek>wingo, dsmith says: https://lists.gnu.org/archive/html/guile-devel/2024-11/msg00057.html
<civodul>hey wingo
<wingo>heya! sorry for being afk, had a very weird december season. will have time for guile this year tho
<wingo>and, i will be in brussels this weekend! looking forward to seeing ppl at the guile/guix days (i arrive thurs evening); where are people organizing?
<wingo>would be happy to join for dinner on thurs evening if there is room
<civodul>wingo: i don’t know if there’s a concrete plan for Thursday evening yet
<civodul>will inquire
<carloratm>I am trying to compile and run an hello world. Got this error: https://dpaste.com/ENJP2A5S7
<lloda>guile -h calls the args to -s, -l etc. 'source files'. Idk if object files are supposed to work 🤔. Maybe you could do guile -c '(load-compiled "hello.scm.go")'
<lloda>i can see the quoting being a bother
<carloratm>thank you
<lshoravi>Hi all
<lshoravi>question about srfi-197, `chain`
<lshoravi>Am I supposed to be able to use the placeholder in nested statements? (chain 1 (+ 5 (+ 5 _))) doesnt work
<lshoravi>I understand that's not the point of the operator but it would be nice
<rlb>wizard: wrt threading macros like clj's, there are also these -- https://codeberg.org/lokke/lokke/src/branch/main/mod/lokke/base/syntax.scm assuming they work right. They're licensed the same as guile (and clj), and some should be straightforward to use, others have some bits (e.g. metadata related) you'd need to remove.
<rlb>...and, of course, any that destructure rely on the "let**" (and via that the destructure-binding-syntax) implementation, which is "more".
<rlb>(where "straightforward" might still involve a bit of adaptation0
<graywolf>Hi! :) Would anyone know why (format #f "~@[~*~a~]" #t 1) does not work? I thought it should return "1", but it just errors out.
<dsmith>graywolf, I think you might be holding it wrong. ~@[ exptects an arg to be #f or something else.
<dsmith>scheme@(guile-user)> (format #f "~@[~d~]" #f)
<dsmith>$1 = ""
<dsmith>scheme@(guile-user)> (format #f "~@[~d~]" 1)
<dsmith>$2 = "1"
<dsmith>"~@[ also treats the argument as a flag, and expects one clause. If the argument is #f then no output is produced and the argument is consumed, otherwise the clause is used and the argument is not consumed, it’s left for the clause."
<graywolf>well yeah that is why I am trying to use ~* to skip one arg ahead
<graywolf>And I fail to understand why it does not work :/
<dsmith>format has a heritage from CL. And I think some of the nil '() #f differences between Scheme and CL aren't quite right in format.
<dsmith>(not the answer to your question)
<dsmith>Maybe bcause ~@[ expects ONE arg, you are trying to use two?
<dsmith>So only one ~thing btween ~[ and ~] ?
<graywolf>Oh that could be it!
<graywolf>~a~a fails with the same error.
<graywolf>Well thanks a lot :) I failed to get this from the documentation.
<graywolf>ACTION finds interesting that ~:[ can handle two args just fine...
<dsmith>"~:[ treats the argument as a flag, and expects two clauses"
<mwette>graywolf: (define fsac (@@ (language tree-il analyze) format-string-argument-count)) ... (fsac "~@[~*~a~]") => 2 2
<graywolf>dsmith: I mean two args per claues, as in ~:[~2*~;~a/~a~]
<graywolf>Which works
<mwette>The compiler checks fmt string vs number of args supplied.
<dsmith>Also. format is buggy.
<mwette>Is this at run time or compile time?
<graywolf>The error? Run time.
<graywolf>And the bugginess is a shame, I find the mini-language format provides quite cool
<dsmith>For example I think the CL version (because nil is false) would be an empty string:
<dsmith>scheme@(guile-user)> (use-modules (ice-9 format))
<dsmith>scheme@(guile-user)> (format #f "~@[[~s]~]" '(a b c))
<dsmith>$1 = "[(a b c)]"
<dsmith>scheme@(guile-user)> (format #f "~@[[~s]~]" '())
<dsmith>$2 = "[()]"
<dsmith>Why have ~% when you can use \n ? Because CL doesn't have \n. Also, might be EBCDIC or some other funky encoding
<graywolf>Oh you are right (at least based on some random online common lisp interpret I found). But for scheme the current behavior sound correct anyway.
<graywolf>I like the whole "anything but #f is true".
<graywolf>(Ok, we also have #nil, so that somewhat breaks the beauty, but whatever.)