From: Markus Date: 2004-10-11T23:45:55+09:00 Subject: Re: ANN: Free-form-operators patch > "Yukihiro Matsumoto" schrieb im Newsbeitrag > > * I am against for user defined operator precedence. It's just > > wrong. So forget about that idea. All user defined operators > > should have same precedence, even if they are allowed. > > On Mon, 2004-10-11 at 02:19, Robert Klemme wrote: > +2 (Also, since precedence is typically implemented in the parser I can > imagine that user defined precedence makes for awful changes in the parser > which has considerable complexity already AFAIK.) The parser part (at least in isolation) isn't too bad. Instead of one operator token (tGENERIC_OP) you have a set of them (tOP1..tOP9 say) which have a range of precedences by varying semantics. The user then gets to choose which token to use for each op. Since these could also be used for many/most of the built-in operators, it might actually simplify the parser. The complication come when you start to work out the "scope" of a declared operator precedence; if it is very global the chance of conflict (I want it to be 7 in my library, you want it to be 3 in yours, and poor Joe requires both libraries) goes way up. But if it is not as global as global can be, there are other problems. The best I have been able to do is come up with a compromise that clearly has both problems. -- Markus