
28 Aug
2003
28 Aug
'03
3:24 a.m.
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: http://citeseer.nj.nec.com/aasa91precedences.html Effectively you end up writing a whole other parser just to handle operators. Cheers, Andrew Bromage