Hi.
I am writing a function called annotate that uses match-lambda -- often with recursive calls to annotate. Here is one of the pattern matches:
(`(lambda (,<param1> . ,<params>) ,<stmts>)
`(CLOSURE ENV (,<param1> . ,<params>) (lambda (ENV) ,(map annotate (map (lambda (x) (append `(,<param1> . ,<params>) (list x))) `(,<stmts>))))))
However, when this pattern is matched this is what returns:
'(CLOSURE
ENV
(x)
(lambda (ENV)
((CLOSURE
ENV
(x y)
(lambda (ENV) ((+ x y))))))
#<void>)
Specifically I can't figure out where "void" is coming from. In fact, if I include the line:
,(displayln (map annotate (map (lambda (x) (append `(,<param1> . ,<params>) (list x))) `(,<stmts>))))
it prints:
((CLOSURE ENV (x y) (lambda (ENV) ((+ x y)))))
notably without "void".
If someone could tell me what the problem is it would be greatly appreciated.
Thanks.