arifshaikh.astro
2021-10-20 07:58:45

@arifshaikh.astro has joined the channel


chansey97
2021-10-20 13:59:04

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>


badkins
2021-10-20 16:22:22

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.


sorawee
2021-10-20 16:23:24

(define a 10) (match a [(== a) 1] [_ 2])


badkins
2021-10-20 16:23:58

Yes! thanks


badkins
2021-10-20 16:24:52

@sorawee I don’t see that in the docs



sorawee
2021-10-20 16:25:19

It’s an extension of match


sorawee
2021-10-20 16:25:28

The match form by itself doesn’t support ==


badkins
2021-10-20 16:26:02

Ah, an extension. Seems like is a case that’s important enough to note further up in the docs.


badkins
2021-10-20 16:27:11

Maybe case would be better in this case…


badkins
2021-10-20 16:31:09

Scratch that.


samth
2021-10-20 16:47:03

You might want evcase instead.


samth
2021-10-20 16:47:25

(but also I wouldn’t phrase that as “the value of a symbol” but “the value of a variable”)


badkins
2021-10-20 21:22:37

I thought I might be (rightfully so) corrected on that :)