[m-dev.] user-defined operators

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Jul 9 18:45:02 AEST 1999


On 09-Jul-1999, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> The only problem with this approach is that we still can't make the
> compose function an operator.
> 
> I guess what we need is something like
> 
> {f1 `compose` f2 X}
> 
> and we collect arguments all the way up to final curly brace to get
> the transformed
> 
> compose(f1, f2, X)

I think

	apply(f1 `compose` f2, X)

or, if you prefer,

	f1 `compose` f2 `apply` X

should do the trick.

If you want it more concise, you could write

	f1 `o` f2 `''` X

but it might be better to save that one for the obfuscated Mercury
competition ;-)

Cheers,
	Fergus.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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