[m-dev.] alternative syntax for pred declarations.
Fergus Henderson
fjh at cs.mu.oz.au
Fri Nov 28 09:36:55 AEDT 1997
On Fri, Nov 28, 1997 at 09:30:18AM +1100, Thomas Charles CONWAY wrote:
> Hi
>
> I've been working on code which has lots of predicates that have
> the same arguments:
> :- pred this_parser(maybe(xxx), parse_state, parse_state).
>
> It would be nice to be able to write:
>
> :- type parser(T) == pred(maybe(T), parse_state, parse_state).
>
> :- mode parser :: (pred(out, in, out) is det).
>
> :- pred this_parser = parser(xxx).
> :- mode this_parser = parser.
>
> Comments?
"=" is not the right thing to use here.
For example, consider the analagous syntax for functions.
The syntax
:- func this_parser = parser(xxx).
already has a meaning.
--
Fergus Henderson <fjh at cs.mu.oz.au> WWW: <http://www.cs.mu.oz.au/~fjh>
Note: due to some buggy software and a (probably accidental)
denial-of-service attack, any mail sent to me between
Tue Nov 25 20:00:00 UTC (6am Wed, local time)
and Wed Nov 26 06:00:00 UTC (4pm, local time)
may have gone into the bit-bucket. Please re-send it.
More information about the developers
mailing list