<div dir="ltr"><div><div><br></div>Hi Racket experts,<br></div><div><br></div>I am reading SICP and trying
this piece of code using Racke:<br><div><div><br>(define (definition-value exp)<br> (if (symbol? (cadr exp))<br> (caddr exp)<br> (make-lambda <br> (cdadr exp) ; formal parameters<br> (cddr exp) ; body<br>
) <br> )<br>) <br><br>(define (make-lambda parameters body)<br> (cons 'lambda (cons parameters body))<br>)<br><br clear="all">( (eval (definition-value '(define (double x) (+ x x))) ) 10)<br>
<br></div><div>In REPL, it return 20 with no problem. <br><br></div><div>However, if I put it into a file and use racket command to run it (with #lang scheme in the file)<br><br></div><div>it complains:<br>compile: unbound identifier (and no #%app syntax transformer is bound) at: lambda in: (lambda (x) (+ x x))<br>
</div><div><br></div><div>Do you have any idea what happened there? How can I solve this problem?</div><div><br></div><div style>Thanks,</div><div style>Alfred<br><br><br></div><div><br><br><br></div></div></div>