[mercury-users] Field access functions

Julian Grady julianpg at students.cs.mu.OZ.AU
Thu Oct 17 23:26:15 AEST 2002


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. However, when I define a type such as the following I get an error.

:- type foo
	--->	constr1(id :: int)
	;	constr2(id :: int).

...

field_test.m:025: Error: field `field_test:id' multiply defined.
field_test.m:025:   Here is the previous definition of field `field_test:id'.
...

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

cheers,
Julian
--------------------------------------------------------------------------
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