@arifshaikh.astro has joined the channel
I tried Chez Scheme inspect/object
, it showed #<procedure>
instead of (lambda (x) x)
(define f (lambda (x) x))
(define x (inspect/object f))
(define x-code (x 'code))
(x-code 'source) ; => #<procedure>
Using match
how do you match the value of a symbol? For example, instead of matching a string literal, I want to use a variable containing that string.
(define a 10)
(match a
[(== a) 1]
[_ 2])
Yes! thanks
@sorawee I don’t see that in the docs
It’s an extension of match
The match
form by itself doesn’t support ==
Ah, an extension. Seems like is a case that’s important enough to note further up in the docs.
Maybe case
would be better in this case…
Scratch that.
You might want evcase
instead.
(but also I wouldn’t phrase that as “the value of a symbol” but “the value of a variable”)
I thought I might be (rightfully so) corrected on that :)