[plt-scheme] Another macro venture

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Sep 9 13:13:57 EDT 2006

On Sep  9, Blake McBride wrote:
> At 11:41 AM 9/9/2006, Eli Barzilay wrote:
> >On Sep  9, Blake McBride wrote:
> > > [...]
> > > Again, all this is trivial to express in a lisp-like macro
> > > system and the few capture situations are easy to avoid with a
> > > little care.
> >
> >Note that even in CL:
> >
> >   (let ((a 1)) (set 'a 3) a) => 1
> >
> >in MzScheme terms, such a `set' would only change bindings in the
> >current namespace, which makes it close to useless.
> 
> I understand.  However, creating the set I seek will give me an
> easy example of evaluating one additional level higher from
> my previous macro difficulty.

I don't think so -- I suspect that this macro is as simple as

  (define-syntax set
    (syntax-rules ()
      [(set where what)
       (namespace-set-variable-value! where what)]))

which is even simpler than that:

  (define set namespace-set-variable-value!)

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


Posted on the users mailing list.