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

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jan 30 19:09:23 AEDT 2002


On 30-Jan-2002, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> Hmmm.  I was going to say I prefer option 2, 3 would be OK, and I find
> 1 confusing.  Then I tried to write a small bit of code to do a little
> arithmetic threading using this scheme and was aghast at what it
> looked like.
...
> 		!=X = 0
...
> 		!+X = !=X + 1

How about

	Current:	!.X
	Next:		!:X
	Pair:		!X

?

Then you have

	!:X = 0,		% Initialize it
	p(!X),			% Update it
	!:X = !.X + 1,		% Increment it
	p(!X),			% Update it some more
	Last = !.X		% Read it

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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