[MLton] Re: [Smlnj-dev-list] Evolving SML

John Reppy jhr@cs.uchicago.edu
Tue, 25 Oct 2005 21:31:36 -0500


Do you mean the semantics or implementation of equality?  The  
semantics are
fairly straightforward: just make equality on records with mutable  
fields be
pointer equality.  In fact, I would argue that refs should be viewed as
syntactic sugar for a record with one mutable field.

If you want to view mutable fields as a derived form (at least  
formally),
then I'd argue for a ref of a record (not a record of refs).  The fact
that individual fields cannot be shared with other data structures is
important.

     - John

On Oct 25, 2005, at 4:18 PM, Peter Sestoft wrote:

> On Tue, 25 Oct 2005, John Reppy wrote:
>
>
>> Here are a few ideas for short-term (and medium-term) features that
>> I'd like to see:
>>
>
>
>>     7. records with mutable fields.
>>
>
> Preferably this should be syntactic sugar for a records with ref
> fields.  OCaml-style updatable records, while useful, would require a
> redesign of equality because updates can create cycles...
>
> Peter
>
>