IRC channel logs
2025-01-27.log
back to list of logs
<jlicht>sneek: later tell dthompson: the support for publishers in haunt is _really_ nifty! <ttz>Yes I did, what about it? <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 <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 <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>...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>scheme@(guile-user)> (format #f "~@[~d~]" 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>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~] <mwette>The compiler checks fmt string vs number of args supplied. <mwette>Is this at run time or compile 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>scheme@(guile-user)> (format #f "~@[[~s]~]" '()) <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.)