[m-dev.] Re: [m-rev.] field syntax (was: smart recompilation)

Peter Schachte schachte at cs.mu.OZ.AU
Fri Jul 6 10:22:40 AEST 2001

On Fri, Jul 06, 2001 at 04:46:45AM +1000, Fergus Henderson wrote:
> One criterion which helps to distinguish between things which are field-like
> and things which are not is that for field-like things, it almost always
> makes sense to talk about setting the field, and setting a field of an
> object to a given value results in a single new object.
> That is definitely true for all of the above, but not true for `toupper'.

*Almost* always, I agree.  But sometimes you want to force other fields to
be set whenenver a particular field is set.  And that's why toupper isn't
field-like.  In fact, you *could* set toupper of a string to another upper
case string the same length, preserving the capitalization of the letters
already present.

But if you want to make the rule that you must *always* define 'foo :=' when
you define '= foo', and enforce that in the compiler, I could live with
that, because I can understand it.  It also means that if I see ^ used to
access something, I know I can use := to set it, which is useful information.
I'd be disappointed to lose the general pipe-like syntax, but I doubt it's
important enough to grab another operator for.

And if I really want to use ^ for toupper, I can always define 'toupper
:='.  Slapping me down for doing so will have to be done in code reviews
(with the attendant debates).

Peter Schachte <schachte at cs.mu.OZ.AU>  The secret of being miserable is to
http://www.cs.mu.oz.au/~schachte/      have the leisure to bother about
Phone:  +61 3 8344 9166                whether you are happy or not. The
Fax:    +61 3 9348 1184                cure is occupation. -- George Bernard
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