Jonathan (>), Carl (>>):
> The only alternative I can think
> of right now would be to disallow even _declaring_ two operators of
> different associativity on the same precedence level... but that kind
> of strictitude doesn't sound very perlish.

That depends on how you phrase the restriction.  If you phrase it as
"all assoc traits that get applied to operators of equivalent
precedence must have the same value", you're right; it doesn't sound
very perlish.  If you phrase it as "associativity is a feature of the
precedence level, not the operator" and adjust syntax accordingly,
it's very perlish.  The syntax adjustments would go something like
this: remove the 'assoc' trait; let people specify an optional assoc
value when they use the 'looser' or 'tighter' traits; and require code
to look up the operator's precedence in order to modify its
associativity.

While I'm not in a position whence I can tell if your solution is
better than the current or not, I definitely like the practice of
changing one's model of the world into one where the problem itself
simply ceases to exist. :)

--
masak

Reply via email to