On Sat, 12 Sep 2009, John Cowan wrote:

> Alaric Snell-Pym scripsit:
>
>> In my ideal dream-world, we'd lose the semantics of set!, and instead
>> have an explicit mutable-cell type.
>
> *Thirty* years later, we're still living with set!, although some
> compilers do introduce cells for mutable variables, so-called
> "assignment conversion", under the covers.

I think set! is often a better abstraction for the kind of lightweight
mutation I need.  It provides more easily verified static guarantees.  For
example, a mutable object can escape from the procedure that creates
it (for example by being returned, perhaps accidentally), whereas
the mutability that comes with set! is strictly confined to the lexical
scope of the binding that introduces the variable.

Andre

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to