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

Jonathan Morgan jonmmorgan at gmail.com
Tue Jan 30 20:59:08 AEDT 2007


On 1/30/07, Gregory James DUCK <gjd at csse.unimelb.edu.au> wrote:
> > > >
> > > >!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.

I think it looks ugly too.

> 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

I don't that this looks right (in is already a valid mode for
non-state-var modes).  In particular, I don't think that this works at
all well for separate pred/mode declarations (there is no way to tell
from the mode declaration what the mode is, you can only find it from
the type declaration).

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

Doesn't work for separate pred/mode declarations.  Doesn't look nice
for predmode declarations.

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