[plt-scheme] Generating top-level definitions from inner syntax

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Oct 9 14:42:18 EDT 2003

On Oct  9, Bruce Hauman wrote:
> If I am not mistaken it looks like capturing the complex computation
> in a local closure would work for your example, because it does not
> seem to allow for module scope use of the defined value.
> 
> So, is the following a good idea?
> 
> (define-syntax lambda-capture
>   [...])

Nice -- this is similar what I was trying, but I wanted a bit more,
something that will do the right thing in these:

  (lambda-capture (capture a) 1)

  (lambda-capture (x) '(capture 3))

  (lambda-capture (x) (let ((capture (printf "!\n"))) 1))

This is possible (by a local syntax where the transformer will add
something to the capture list), but at that point I figured that the
complexity not worth the benefits.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.