IRC channel logs

2023-12-10.log

back to list of logs

<euouae>Hello
<euouae>I have this script to run tests on my project
<euouae> <https://termbin.com/wxbx>, why doesn't the "General Case" run?
<euouae>I'm also trying to run this <https://termbin.com/3job> from the command line with either `env GUILE_LOAD_PATH=. guile -e main -s foo.scm` or `-l foo.scm` but neither work
<euouae>I have a bar.scm with a define-module and a `message` variable. Why is this not working? I've also tried compiling it with guild but I get an error about message being potentially undefined
<apteryx>is there something like map that also provides the index of the item in the list?
<apteryx>ACTION reaches to a named let
<euouae>apteryx: there is for vector
<euouae>vector-for-each
<apteryx>ah; nice to know, thanks!
<euouae>apteryx: you're welcome
<dsmith>enzuru, Use ((= i 10)) instead of (= i 10)
<dsmith>sneek, later tell euouae Use ((= i 10)) instead of (= i 10)
<sneek>Got it.
<dsmith>enzuru, was meant for euouae
<ieugen>I am trying to learn guile while doing adventof code and I get an error message that does not help at all
<ieugen>running https://github.com/ieugen/adventofcode/blob/66acd57895d867f90ca16f1e5b68818bbe4bb2b1/an2023/01-trebuchet.scm#L236 gives me
<ieugen>ice-9/boot-9.scm:1676:22: In procedure raise-exception:
<ieugen>Value out of range 0 to< 4: 8
<ieugen>I am also finding emacs very unfriendly to work with ...
<Arsen>emacs' a bit of a steep learning curve, yeah
<Arsen>ieugen: your error happens because one of your start indices are outside the bounds of your string
<Arsen>try, for instance, (string-contains "abcd" "b" 5) in the repl
<ieugen>thank you Arsen: but is guile error reportin so "bad" ? I did a lot of coding in java and you get a wall of text but you can track the line that caused it
<ieugen>any way I can display the stack trace here ?
<Arsen>it does do that
<RhodiumToad>what other lines did you get in the backtrace?
<RhodiumToad>use a paste site
<Arsen>though, for some reason it printed:
<Arsen>In unknown file:
<Arsen> 0 (string-contains "nine" 4 8 #<undefined> #<undefined> #)
<Arsen>:(
<ieugen>ice-9/boot-9.scm:1676:22: In procedure raise-exception:
<ieugen>Value out of range 0 to< 4: 8
<ieugen>[Debugging level: 31]
<Arsen>hopefully (guile)Debugging can shed some light
<ieugen>this is all I get
<Arsen>hmm, which guile version is that
<ieugen>I dno't know how to debug - especially in Emacs - which is something new as well
<ieugen>* I do know how to debug - but not in Emacs
<Arsen>ah, I was running it directly. I don't recall exactly how geiser works
<Arsen>(geiser being the scheme integration for emacs)
<RhodiumToad>you might get more or better info by invoking guile as guile --debug
<ieugen>thanks - I made some progress
<ieugen>I am missing something like this for guile https://clojuredocs.org/clojure.core/when
<Arsen>guile does have when, (let ((x 5)) (when (= x 4) (display "foo\n")))
<ieugen>yes, but clojure when returns nil if condition is not true while guile returns unspecified
<ieugen>it's hard to find that through all the manual
<Arsen>well, the documentation for 'when'/'unless' defers to 'if', which states:
<Arsen> When ALTERNATE is omitted and the TEST evaluates to ‘#f’, the value
<Arsen> of the expression is not specified.
<ieugen>hence why I miss something like clojuredocs.org - it's very usefull - esp if you not familiar with functions
<ieugen>+ you get examples
<Arsen>ACTION shrugs
<Arsen>I can't say I've ever used or seen clojure docs
<ieugen>try the link above
<Arsen>I'm sure improvements to guile docs are welcome