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

Tyson Dowd trd at cs.mu.OZ.AU
Thu Jul 5 19:18:55 AEST 2001


On 05-Jul-2001, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Wed, Jul 04, 2001 at 01:28:55PM +0200, Peter Ross wrote:
> > Simon wrote:
> > > On 04-Jul-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > > > For one thing, it makes the .NET mapping nicer, as we can generate a get
> > > > and set property for foo = and foo :=
> > >
> > > .NET should be irrelevant to this discussion. We should not be
> > > designing high-level language features based on implementation
> > > details of one of the back-ends. That sort of thing is what
> > > pragmas are for.
> > >
> > I disagree, we should use the appropiate mapping of a mercury feature to the
> > back end feature.  Currently this is not possible on the .NET backend
> > because we have no way of distinguishing between a normal function and a
> > function which represents a `get' field access.
> 
> I think Simon's suggestion of a pragma is better.  I cringe at the thought
> of using the spelling of a function name to determine what sort of back end
> code to generate for it.  It's just too reminiscent of FORTRAN deciding
> whether a variable is int or float based on its first letter, or BASIC
> deciding it's a string if it ends with a $.  Too many times have I spent
> hours trying to figure out why something wasn't working, and finally, in
> desparation, changed the name of something to to discover the system had
> some peculiar rules for certain names.

This is a red-herring, as the examples you are giving are where a source
language feature is determined by the spelling of a function name, not a
backend feature (if you want to argue backend features, we need a new
email).

However, the current Mercury language already supports code where the
spelling of a function name affects the source -- setter functions are
distinguished based on spelling.

If you really want to argue your point, you should instead be
arguing that putting := into the name of setter functions is broken.
This is akin to the case with FORTRAN or BASIC.

I would prefer to fix it by spelling *both* setters and getters
in a special way.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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