lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wednesday 24 March 2004 16:36, Firestone, Rameses wrote:
> I need the (+ - * /) operators for similar things to what they do now.
> The (.. ^) operators are a possibility but their precedence makes them
> problematic. Another possibility would be a generic user definable
> operator such as ~operator_name~. I could then write something like
> "e1.x - e2.x < 50 ~or~ e1.x - e2.x > 200". I realize this is probably
> a major change. I'm just thinking out loud.

Perhaps not such a major change... it's already possible to simulate a 
high-precedence operator which looks like this:

(e1.x - e2.x < 50) :otherwise (e1.x - e2.x > 200)

Perhaps just one new level of precendece would suffice? E.g.

e1.x - e2.x < 50 !otherwise e1.x - e2.x > 200

would have exactly the same semantics, but using the ! would imply a low 
precedence. That ought to be a fairly simple change to the parser.

-- Jamie Webb