[racket] help: how to make eval see local bindings?

From: Markku Rontu (markku.rontu at iki.fi)
Date: Tue Jul 12 10:11:24 EDT 2011

On Tue, Jul 12, 2011 at 4:36 PM, maurizio.giorda
<maurizio.giorda at gmail.com>wrote:

> **
> Hi Matthias,
>
> ... I will play with your example (it is better than all the words I spent
> with my looong
> description:
>
>  Here is what I meant:
>
>  #lang racket
>
>  (define-syntax-rule
>   (mm x)
>   (lambda (w) (displayln `(,x)) (+ w x)))
>
> Ok, fine!
>
>
>  (define f
>   (let ([a 10])
>     (mm a)))
>
>  (f 42)
>
> Let me define my function in a inner scope:
>
> > (let ((othervar 2)
>           (f (mm (+ 1 othervar))))
> >  (f 1)
>
> it should print 4 but it gives the undefined identifier error.
> If I define "othervar" globally (top env) it works (of course!).
>
>
Do you want a let* here instead of let?

-Markku
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110712/d5e1bc73/attachment.html>

Posted on the users mailing list.