Hello everybody,<br><br>This is my first post to Racket mailing list and hopefully not my last one.<div><br></div><div>I am working on a project at my university that has to do with genetic programming. I wanted to implement the whole assignment in Racket because of some of its really cool features that I found useful.<br>
<div><br></div><div>I create a randomly chosen tree of expressions with "bound" symbol, say x. Something like this:</div><div><br></div><div>(define tree '(+ x (* 3 (* x x)))</div><div><br></div><div>Now I want to turn into a procedure by calling</div>
<div><br></div><div>(tree->proc tree 'x)</div><div><br></div><div>I defined this function like this</div><div><br></div><div>(define (tree->proc tree symbol)</div><div> (eval `(lambda (,symbol) tree)))</div><div>
<br></div><div>and it works in the REPL, but when i call tree->proc from inside the definitions window it produces the error</div><div>"compile: unbound identifier (and no #%app syntax transformer is bound) in: lambda"</div>
<div><br></div><div>I have tried several other Scheme implementations and they do not complain about this. From what I've learned from "JRM's Syntax-rules Primer for the Merely Eccentric" certain environments do not have syntactic mapping for function calls.</div>
<div><br></div><div>I guess it is something trivial but cannot figure it out from the documentation.</div><div><br></div><div><br></div><div>/Milan</div><div><br></div></div>