[m-rev.] for review: state vars syntax sugar

Ralph Becket rafe at csse.unimelb.edu.au
Thu Jan 25 14:43:41 AEDT 2007

Ben Schmidt, Thursday, 25 January 2007:
> There was lengthy discussion about this (thread: [m-dev.] syntactic 
> suggar suggestion for state variables). I think the consensus of the 
> list was *not* to use ! in the mode part of the declaration, but to have 
> the syntax as Ondrej implemented it. Reasoning:

Having reviewed that discussion, I still think (as I did when I wrote
the review) that no consensus was arrived at: a number of suggestions
were made and some were supported by various people.

> - Using !(in,out) looks like it should expand to (in0,out0),(in,out), 
> i.e. four arguments, or two pairs, which it doesn't.
> - If using ! as a functor for modes, it should take an inst argument if 
> anything, but what is wanting to be done isn't parameterisable in terms 
> of an inst argument (at least at present).
> - The syntax as implemented by Ondrej is the one suggested in the 
> existing compiler code.

I was the one that wrote that code!  My point is that state variables
destroy the simple logical reading of code and the `!' is a persistent
indicator that any code using state variables should be read with an
imperative view.  I would like to preserve that visual clue: "there's an
exclamation mark, this must pertain to a state variable!"

But Mark is correct: the documentation should come first, then we can
have the syntax war...

-- Ralph
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