[plt-scheme] Newbie Schemer question

From: Jerzy Karczmarczuk (karczma at info.unicaen.fr)
Date: Wed Nov 6 03:24:30 EST 2002

Daniel CAUNE wrote:

> I would like to execute a function that has one of its variable defined
> outside this function, in an upper context. Suppose that I define a simple
> function such as:
> (define (f n)
>   (+ *p* n))
> I would like to write something like that (the following syntax is
> incorrect):
> ((let ((*p* 1))
>   (lambda ()
>     (f 2)))
> How should I formulate this in Scheme?

Use fluid-let.

Jerzy Karczmarczuk
Caen, France

Posted on the users mailing list.