<hugo>I actually "needed" #:hide a few days ago... oh well ***apteryx_ is now known as apteryx
<wingo>civodul: i just pushed my rewrite of the unbound-vars analysis pass <wingo>i hadn't posted it before ;) <wingo>just managed to find spare time to get it into shape this morning <civodul>i'm lagging behind and i've come to assume i've likely missed something <civodul>but yeah, a new release would probably be welcome <wingo>haha i am lagging behind too, just assuming that people commit anything that's important ;) <wingo>anyway this pass will warn when compiling md5.scm <wingo>md5.scm:71:0: warning: non-idempotent binding for `+'. When first loaded, value for `+` comes from imported binding, but later module-local definition overrides it; any module reload would capture module-local binding rather than import. <wingo>md5.scm:72:0: warning: non-idempotent binding for `ash'. When first loaded, value for `ash` comes from imported binding, but later module-local definition overrides it; any module reload would capture module-local binding rather than import. ***w2gz is now known as w1gz
*wingo starts a fresh rebuild <wingo>10 minutes on a laptop; could be worse <civodul>that's with the pre-built .go files, right? <wingo>civodul: no, that was without prebuilt .go files <wingo>baseline compiler ftw i guess <wingo>============================================= <wingo>guile-3.0.5 archives ready for distribution: <wingo>============================================= <leoprikler>is there a way of still squeezing 45131 into the release? :) <chrislck>hmm will the new unbound-var also suggest (use-modules ...) perchance? <wingo>leoprikler: it is already out, sorry :/ but happy to make a new one <wingo>leoprikler: do you have commit access? if so feel free to push that patch <leoprikler>I do have commit access to Guix, but I don't think that extends to Guile. <wingo>what is your savannah user name? <wingo>in the year of our lord 2021 my upload speed is... 80 kB/s :/ <civodul>chrislck: no, it's not entirely clear to me how to integrate it, as discussed on guile-user <chrislck>umm ok, guix does a fine job as it is. first time seeing it was a pleasant surprise. <chrislck>(unless it's not obvious yet - I don't need it, but believe it'll significantly lower the entry bar) <faLUCE>hello, given the following list: ((x-ref-of-1 . true) (blabla . true)) how can I check if (blabla . true) is in the list ? <leoprikler>((@ (srfi srfi-1) member) '(blabla . true) list equal?) <chrislck>faluce: (1) you probably forgot the ' (2) guile usually uses #t instead of 'true (3) plain member works well <faLUCE>chrislck: yes, but it has to be a string <faLUCE>chrislck: leoprikler how can I obtain the same with memq ? <leoprikler>faLUCE: (let ((needle '(blabla . true)) (haystack (list '(x-ref-of-1 . true) needle))) (memq needle haystack)) <leoprikler>or with srfi-1 member by passing eq?/eqv? instead of equal? <faLUCE>leoprikler: thanks. Sorry for the dumbass question: I hat to (display "found\n") if (blabla . true) is inside and "not found\n" if it is not. How can I put that into an if statement? <chrislck>(display (if ... "found\n" "not found\n")) where ... is your conditional of choice <faLUCE>sorry again: what if I have to (set! somevar "foo") if (blabla . true) is inside ? <leoprikler>civodul, chrislck: how would the following sound: when an unbound variable occurs, guile first checks the core modules for a definition, then checks GUILE_LOAD_PATH if some fluid (e.g. %unbound-variable-extensive-search) is #t? <leoprikler>faLUCE: (when (member '(blabla . true) list) (set! somevar "foo")) <Anonymous__>(and (member '(blabla . true) l) (set! somevar "foo")) <civodul>leoprikler: the "problem" discussed on guile-user is that it's unclear where/how Guile would print that <civodul>in the exception printer? but that seems hacky <civodul>with specific handling at the REPL? but then you won't see it in other cases <leoprikler>I think you could make it so that --debug also sets up the same handler, that the REPL would use, no? <leoprikler>Then you'd still have to use --debug, but you'd have an easy way of debugging your code, when such an exception occurs <leoprikler>faLUCE: note however, that Scheme much prefers the functional style, and the more functional your program becomes, the less set!s you will have <leoprikler>specifically the act of setting a variable to some value if something is found appears rather imperative in nature. In functional values, you'd say (let ((found? (and (member ...) #t))) ...) <dsmith>wingo: Did that recent fix in lightening make it into 3.0.5 ? <chrislck>civodul: not sure why it's hacky to print in the exception printer. unbound-variables are bound to fail loudly... so what's the harm in being a little louder (and much more helpful) <chrislck>I thought the dilemma was to search the core modules, or core modules + load-path. <chrislck>(IMV, either... or use a fluid like leoprikler says) <civodul>chrislck: conceptually, the exception printer should do just that: print the exception (in less than a line, etc.) <civodul>also, it should not fail, preferably :-) <civodul>dunno maybe i'm too conservative/cautious <chrislck>civodul: as a (not anymore) beginner I sincerely disagree... a hard fail is the best way to learn <leoprikler>But what exactly is the "hard" fail in this case? <leoprikler>I agree with civodul, that the printer itself should just print the exception record. <chrislck>huh easy, your .scm has a (vector-for-each) somewhere in the middle of a function, you forgot too include relevant srfi, and run <leoprikler>Though tbf. we could also special case unbound variables in the uncaught exception handler <manumanumanu>wingo: Oooh! cool job with the comparison chains. I have the perfect use-case if you want to show off some benchmarks. It is a 100-clause case with about a thousand elements each. All symbols, characters and integers. I am expecting a spectacular speedup