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

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jul 4 20:04:05 AEST 2001


On 04-Jul-2001, Simon Taylor <stayl at cs.mu.OZ.AU> 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.

I agree that the implementations details of .NET should not be relevant.

The real issue here, though, is interoperability with languages like C#,
Eiffel, and Sather.  It has happened to show up in the mapping to .NET,
but the same issue would arise in any attempt to interoperate with
C#, Eiffel, or Sather, regardless of the underlying implementation
technology.

The question is, when the compiler sees a Mercury function `foo',
should it map that function to an Eiffel/Sather attribute / C# property,
as would be appropriate if the function is intended as a field accessor,
or should it map it to a static member function which takes the object
as the first parameter, as would be appropriate for arbitrary
non-field-accessor functions?

With the current Mercury syntax, there's no way to tell,
because the Mercury syntax doesn't distinguish between these.
Thus an additional pragma is required.

But if the syntax was changed, as I think it should be for readability,
this would have the nice side-effect that you wouldn't need to use
pragmas to distinguish between these two.

-- 
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-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