[m-dev.] Reopened: state vars syntax sugar

Gregory James DUCK gjd at csse.unimelb.edu.au
Tue Jan 30 13:15:02 AEDT 2007


Hi,

> > >
> > >!mytype::in!out
> > >
> > >To me it seems clear that the second '!' means 'state variable' but
> > >doesn't mean 'expands to twice as many arguments'.
> >
> > I think it looks ugly.
>
> I'm with Julien on this one.

Jumping in late here...
I think they are all kind of ugly.
I'll throw in a late wildcard entry (apologies if this has been
suggested/rejected before):

!mytype::in

In general, !T::M shorthand for
T::M, T::output(M)
where output(M) represents an output mode based on the input mode:

output(Inst >> _) = free >> Inst

Works for the common cases.

-Greg.

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list