[plt-scheme] boxes?

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Jan 24 14:33:51 EST 2007

On Jan 24, Joe Marshall wrote:
> On 1/23/07, John Clements <clements at brinckerhoff.org> wrote:
> >
> > No, you're exactly right: set! changes a _binding_.
> >
> > Furthermore, you're also exactly right in saying that the
> > similarities in syntax can be confusing.  Don't be suckered,
> > though: set-car! changes a _value_, not a binding.
> >
> > I think you will find many sympathetic ears in suggesting that
> > set!  and set-car! are unfortunately close.
> 
> If I could work my will I would remove set! from the language
> altogether.

Should be doable now: just make

  (set! id expr)

expand to

  (set-box! id expr)

(But I prefer renaming `unbox' to `ref', then use the generic setter
thing to use (set! (ref x) expr).)

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


Posted on the users mailing list.