[plt-scheme] boxes?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Jan 24 17:54:02 EST 2007

On Jan 24, 2007, at 2:31 PM, Joe Marshall wrote:

> On 1/24/07, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
>>
>> We have taught with this restriction at Rice (i.e., set-box! without
>> set!).
>> It's painful.
>>
>
> I do have a question about the pain introduced by allowing set-box!
> but not set! .
> set! is a very nasty operation that is hidden by a deceptively  
> simple syntax and
> a simple, but incorrect, semantics (that is, most students *think*
> they know what
> it means and are sorely mistaken).  Is the pain of using set-box!  
> due to the
> clumsiness of manually boxing things, or is it simply exposing the
> latent nastiness
> of set! ?

The pain I was referring to is all about explicit unboxing:

  ;; x = x + 1
  (set-box! x (+ (unbox x) 1))
  ;; versus
  (set! x (+ x 1))

One could do something about this but I do dislike implicit coercions.
They remind me of LL700 :-) too much.

-- Matthias









>
>> If you mean all set*!, then you need to convince a whole lot of
>> people first.
>
> I know.  The world is not ready for this idea so I'm procrastinating
> on starting my
> crusade.
>
> -- 
> ~jrm



Posted on the users mailing list.