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

Ralph Becket rbeck at microsoft.com
Wed Jul 4 19:51:58 AEST 2001


> From: Tyson Dowd [mailto:trd at cs.mu.OZ.AU]
> Sent: 04 July 2001 09:46
> 
> On 03-Jul-2001, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> >
> > Ah, but part of the design is to allow you to create pseudo-fields
by
> > writing a function or two.  This means that you can use field access
> > functions (and field access syntax) outside the defining module
without
> > forcing yourself to always have that field (as long as you can
extract and
> > maybe set equivalent information somehow).  So Object ^ field may or
may not
> > be a real field.
> 
> That is fine, this is part of the design that is nice.
> 
> But it doesn't have to have the syntax Field(Object).

I don't see what the problem is.  I find the field access stuff easiest
to understand as a syntactic transformation.

> > So Tyson, why do you want to make this distinction so strongly?
> 
> I just want to be able to draw the distinction.
> 
> For one thing, it makes the .NET mapping nicer, as we can generate a
get
> and set property for foo = and foo :=
> 
> I also think it's a bit of a wart in the current design that you can
> write a
> 	X = "hello" ^ to_upper
> 
> but to_upper is not a field access function and was never intended to
be
> one.

Are you saying that it is bad style to use field access functions
for other purposes and that the language should forbid such things?

For the record I'd vote against such a proposal [let the holy syntax
wars begin...]

As I mentioned in reply to David Overton's posting, I find the idiom
using (^) as a kind of reverse function composition to be an aid to
readability, but that's probably because my view of field access is
that it is just syntactic sugar.

- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list