[mercury-users] Field access functions

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Oct 17 23:49:42 AEST 2002


On 17-Oct-2002, Julian Grady <julianpg at students.cs.mu.OZ.AU> wrote:
> I thought I read somewhere that it was possible to have multiple data
> constructors with the same field name as long as they belonged to the
> same type.

Perhaps in the Haskell Report? ;-)

The Mercury language reference manual is pretty clear about this:
"It is an error for two fields in the same module to have the same label."

> Is it ever possible to have multiple constructors with the same field
> name?

Only if those constructors are defined in different modules (and hence
are constructors for different types).

-- 
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-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list