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 &quot;bound&quot; symbol, say x. Something like this:</div><div><br></div><div>(define tree &#39;(+ 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-&gt;proc tree &#39;x)</div><div><br></div><div>I defined this function like this</div><div><br></div><div>(define (tree-&gt;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-&gt;proc from inside the definitions window it produces the error</div><div>&quot;compile: unbound identifier (and no #%app syntax transformer is bound) in: lambda&quot;</div>
<div><br></div><div>I have tried several other Scheme implementations and they do not complain about this. From what I&#39;ve learned from &quot;JRM&#39;s Syntax-rules Primer for the Merely Eccentric&quot; 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>