The amb -< operator is not defined

Viewed 77

I see this in the lecture slide

> (+ 10 (-< 1 2 3))
11
> (next)
12
> (next)
13
> (next)
'done

But when I tried it my own in DrRacket, it came up with an error

> (+ 10 (-< 1 2 3))
. . -<: undefined;
 cannot reference an identifier before its definition
> 

The slide didn't indicate any requirement. I also google "racket -<: undefined", but seems google can't find any result relate to the symbol -<. How can I fix it?

1 Answers

Based on the link to the slides that you posted, it appears that the -< form is defined as a macro (using syntax-rules) on slide 19/48. After you add that macro definition to your program, you should be able to use the -< form.

Related