[m-dev.] alternative syntax for pred declarations.
Fergus Henderson
fjh at cs.mu.oz.au
Mon Dec 1 16:21:09 AEDT 1997
On Mon, Dec 01, 1997 at 04:16:25PM +1100, Thomas Charles CONWAY wrote:
> Fergus Henderson, you write:
> >
> > This is getting better, but there are still some problems.
> >
> > The syntax
> >
> > :- mode this_parser :: parser.
> >
> > already has a meaning.
> > It is the same as the (undocumented) alternative
> >
> > :- mode this_parser == parser.
>
> Gosh! How about changing its meaning then?
That would have some problems, starting with backwards compatibility.
> Is it necessary to have two different ways of writting the same
> thing (especially since it is something that is written infrequently,
> and neither syntax is can really be considered easier to use than
> the other)?
The `::' syntax was chosen because it works better than `==',
because `==' doesn't really have the right precedence.
In particular,
:- mode out == ground -> free.
is a syntax error, because it parses as
:- mode (out == ground) -> free.
whereas
:- mode out :: ground -> free.
parses correctly.
--
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