[mercury-users] Records

Ralph Becket rbeck at microsoft.com
Tue Nov 2 21:47:24 AEDT 1999


This is great stuff - I have but one whinge...

> 	% field update.
> 	X1 = X0 ^ field1 := 2,		% X1 = t(2, "abc", t2(1.5, 'y')).

it's a very minor point, but `:=' smacks too much of assignment to me.
But any other notation I can think up off the top of my head is less
clear.

Question no.1: can I do something like

      FieldName = field1,
      Field1 = X1 ^ FieldName

If so, I wonder whether this sort of mechanism is way open to abuse
by the undisciplined.

Question no.2: are typeclasses going to be extended to have fields?
e.g.

	:- typeclass foo(T) where [
		a_field :: int, 
		pred foo...
	].

Cheers,

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