IRC channel logs
2021-09-22.log
back to list of logs
<fnstudio>hello! anyone has an example of a case statement at their fingertips and wants to share that with me? in particular, is it possible/convenient to use strings as key/datums? <fnstudio>i'm asking since i'm receiving some warning with regard to "datum [...] cannot be meaningfully compared using `eqv?'" <RhodiumToad>strings can't be used for case keys, use symbols or keywords <fnstudio>RhodiumToad: oh cool, thanks, that answers my problem <RhodiumToad>strings with equal content are equal? but usually are not eqv? unless they derive from some common source <RhodiumToad>whereas symbols with the same names are not only eqv? but eq? <fnstudio>RhodiumToad: i see, yes that helps, i had some vague memory that strings can't be used in case statements because of that but i didn't remember what the solution was, switching to symbols <fnstudio>hello, i'd like to use lset-intersection against a list of lists <fnstudio>i thought it was a matter of using apply against the list but i don't seem to be able to make it work <fnstudio>my particular problem is about lset-intersection but there is probably a more general question behind this in terms of how to "unpack" a list and make it work as a multi-arg argument for a given function <fnstudio>i naively tried something along the lines of "(define (get-intersection lists) (apply (lambda (x) (lset-intersection equal? x)) lists))" <lloda`>you can do (apply lset-intersection equal? lists) <fnstudio>i thought the equal? thing might get in the way and a lambda was needed, i'm trying now <lloda`>apply accepts any number of arguments before the final list argument <fnstudio>lloda`: ah i see, and it works perfectly, thank you very much!! <manumanumanu>wingo: just a heads up regarding match.scm, it has gotten extended with object, struct and @ matching. object and struct I don't know what it does, but @ does record matching by field name. <manumanumanu>wingo: object is an alternative name for @ and struct an alternative name for $. Not documented, so can be ignored. <lispmacs[work]>hi, I'm working through the debugging information in the Guile reference manual for 3.0.7. However, all the "binding" procedures in 6.26.1.3 do not seem to be accessible to me. Do I need to load a special module first/