[m-dev.] for review: improve higher-order syntax

Peter Schachte schachte at cs.mu.OZ.AU
Sun Feb 13 13:33:10 AEDT 2000


I've only reviewed the doc.

> Workspace: /d-drive/home/hg/fjh/mercury
> Index: doc/reference_manual.texi
> ===================================================================

...[snip]...

> +A higher-order term is a term, other than a name or an operator term,
> +followed without

If I read this right, you can use an operator term as a HO "functor" by
wrapping it in parenthesis like so:

	(F1 `compose` F2)(Arg)

It would be helpful to explicitly mention this.

> +any intervening whitespace by an open parenthesis (i.e. an open_ct token),
>  a sequence of argument terms separated by commas, and a close
> -parenthesis.  A higher-order term is equivalent to a compound term
> +parenthesis.  A higher-order term is equivalent to a simple compound term
>  whose functor is the empty name, and whose arguments are the 
>  the variable followed by the arguments of the higher-order term.

The word "variable" here is no longer appropriate.

>  That is, a term such as @code{Var(Arg1, @dots{}, ArgN)} is
> -parsed as @code{''(Var, Arg1, @dots{}, ArgN)},
> +parsed as @code{''(Var, Arg1, @dots{}, ArgN)}.

And probably here, too.


-- 
Peter Schachte                     About the time we think we can make ends
mailto:schachte at cs.mu.OZ.AU        meet, somebody moves the ends.
http://www.cs.mu.oz.au/~schachte/      -- Herbert Hoover 
PGP: finger schachte at 128.250.37.3  
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list