[m-dev.] record syntax

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 29 10:08:22 AEDT 2000


On 29-Nov-2000, Michael Day <mikeday at corplink.com.au> wrote:
> 
> > 	:- type abstract(T).
> > 	:- func field_a(abstract(T)) = int.
> > 	:- func field_b(abstract(T)) = int.
> > 	:- func field_c(abstract(T)) = int.
> > 	:- func 'field_a:='(abstract(T), int) = int.
> > 	:- func 'field_b:='(abstract(T), int) = int.
> > 	:- func 'field_c:='(abstract(T), int) = int.
> 
> How come the 'field_blah:=' functions return int rather than abstract(T)?

My mistake.  It should be abstract(T).

> And what is the mode of these functions?

Same as the usual default mode for functions, i.e. all args input
and the function result output.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list