[m-dev.] State variable syntax - last call for opinions

Holger Krug hkrug at rationalizer.com
Wed Jan 30 18:47:23 AEDT 2002

On Wed, Jan 30, 2002 at 05:57:15PM +1100, Ralph Becket wrote:
> 		!>X = X<! + 1
> Any takers?

It didn't follow the discussion up to now, but I would say, this is by
far the best proposal. Actually a further alternative would be:

              !>X = X>! + 1

which expresses the semantics more clear ( `!>X' means "write to" and
`X>!' means "read from" ), but deteriorates readability. Hence I would
prefer your proposal.

Following Peters proposal, one could go a step further:

         !X means !>X, X<! in an atom

but I would not go this way: it maybe enhances "writeability", but
surely deteriorates readability (does it ? didn't test it), which
should be decisive.


Maybe we are beliers. Peter, Ralph and now I tested the proposals only
against `=' as operator. So what about:

             X<! > 3

Also not too nice, isn't it.

Hence a last proposal:

             !X = ?X + 1
             ?X > 3

Nice, short, semantically clear. As I understand, it also does not
break the Mercury lexic, does it ?

And now the very last proposal:

For the lazy one's you could provide

              X += 1
              X *= 2

as shortcuts for
             !X = ?X + 1
             !X = ?X * 2

Was this considered ? And what was the result of the consideration ?
I like this Perlcury syntax.

Holger Krug
hkrug at rationalizer.com
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list