Prefix and postfix operators

Andrew J Bromage
Thu, 28 Aug 2003 17:24:49 +1000

G'day all.

On Thu, Aug 28, 2003 at 11:05:52AM +0200, Ketil Z. Malde wrote:

> We already have prefix operators, don't we?  I.e., regular functions
> are prefix?

Not really.  This:

	- sqrt x

Doesn't mean the same thing as this:

	negate sqrt x

I think the difficulty is that it's very hard to convert a general
operator grammar into a context-free grammar, particularly if you
can set precedences and associativities at run-time.  See, for example:

Effectively you end up writing a whole other parser just to handle

Andrew Bromage