[m-dev.] record syntax

Peter Ross peter.ross at miscrit.be
Wed Nov 29 20:50:05 AEDT 2000


On Wed, Nov 29, 2000 at 09:39:19AM +1100, Fergus Henderson wrote:
> On 28-Nov-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> > I think we should add the following to the record syntax for allowing
> > the use of the record syntax for abstract types.
> > 
> > :- interface.
> > 
> > :- type abstract(T) with [field_a, field_b].
> > 
> > :- implementation.
> > 
> > :- type abstract(T)
> >     --->    f(
> >                 field_a :: int,
> >                 field_b :: int,
> >                 field_c :: int
> >             ).
> > 
> > Any objections?
> 
> Yes: the interface needs to specify the field types.
> 
> Are you aware of the existing syntax for this?
> 
Yes, but I find the verboseness to be a big drawback.

How about 

:- type abstract(T) with [field_a :: int, field_b :: int].
--------------------------------------------------------------------------
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