[m-rev.] For review: State-variable record update transformation

Peter Schachte schachte at csse.unimelb.edu.au
Mon Mar 5 14:02:03 AEDT 2007


Julien Fischer wrote:
> On Fri, 2 Mar 2007, Peter Schachte wrote:
>> If you can write
>>
>>     !X ^ f1 ^ f2 := Expr
>> and
>>     !X ^ f3 := Expr
>>
>> it seems a bit inconsistent not to be able to write
>>
>>     !X := Expr
> 
> I don't think it is inconsistent not being able to write that.  The
> proposed syntatic sugar is for field updates in combination with
> state variables.  Field updates are recognised by the presence of the
> field accessor, '^', in addition to ':='.

All true, but beside the point.  My point is about people's natural expectation
and intuition.  If you can use := to replace part of a term, it seems a pretty
natural generalisation to use it to replace the whole term, particularly since
that's how that syntax works in Algol-like languanges.  It's a bit strange to
tell people not to think of state variables as allowing destructive update, but
then provide a syntax widely used in other languages for destructive update to
do something very much like destructive update in Mercury.  It looks and quacks
too much like a duck for the denials to carry much weight.

-- 
Peter Schachte              Basically, Clinton's approach to America is,
schachte at cs.mu.OZ.AU        "Vote for me, I'm not Newt Gingrich."
www.cs.mu.oz.au/~schachte/      -- Ralph Nader
Phone: +61 3 8344 1338
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list