[m-dev.] alternative syntax for pred declarations.

Fergus Henderson fjh at cs.mu.oz.au
Mon Dec 1 16:12:00 AEDT 1997


Andrew Bromage wrote:
> 
> Thomas Charles CONWAY wrote:
> 
> > 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.
> 
> I agree with Fergus that this is not quite the right syntax.
> 
> Since the current plan is to use ':' for type qualifiers and '::' for
> mode qualifiers, so I guess it would make sense to use these here too:
> 
> :- pred this_parser : parser(xxx).
> :- mode this_parser :: parser.
> 
> If we want to do currying:
> 
> :- pred match_token(token) : parser(unit).
> :- mode match_token(in) :: parser is det.

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.

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