[m-dev.] syntactic suggar suggestion for state variables

Ralph Becket rafe at csse.unimelb.edu.au
Mon Jan 15 08:27:18 AEDT 2007


Peter Wang, Sunday, 14 January 2007:
> On 2007-01-12, Ondrej Bojar <obo at cuni.cz> wrote:
> > Ralph Becket wrote:
> > >>Would it be possible to extend the syntax to allow:
> > >>
> > >>:- pred p(mysvtype::!(in, out)) is det.
> > 
> > So the question is now, if the type+mode declaration should be:
> > 
> > :- pred p(mysvtype::!(in, out)) is det.
> > % more concise
> > 
> > or
> > 
> > :- pred p(!mysvtype::!(in, out)) is det.
> > % better parallel with the separate mode-type decls.
> 
> What about:
> 
>     :- pred p(!mysvtype::in..out) is det.
> 
>     :- pred p(!mysvtype).
>     :- mode p(in..out) is det.
> 
> Or some other infix symbol?

If we're going to do this, I think we should have a single symbol (!) to
indicate state variables.  !(in, out) really isn't that much more to
type than in..out.

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