Esteban A. Maringolo wrote
> If one thing confuses people in that realm is non arithmetic precedence:
> Eg. 2 + 3 * 4 = 20 instead of the "expected" 14.
> 
> And we're not going to change that either. It's not worthy, and I
> doubt if it is possible at all.

I'm probably late to the party with this reply. The primary reason for not
changing this is that it would be incorrect. It comes down to intrinsic
versus extrinsic meaning. A multiple operator has an intrinsic meaning: it
means multiple. But a message name does not have intrinsic meaning (other
than it is a good idea to have the name represent what it does). The meaning
of a message is determined by the receiver. e.g. if PetitParser defines #*
to mean "0 or more repetitions", what happens when someone has decided that
it should be evaluated before #+?

Message sending precedence can only be defined in terms of the type of
message: unary, binary (or infix), and keyword, since the interpretation of
the message is the receiver's responsibility, not the compiler's.




--
View this message in context: http://forum.world.st/about-tp4764892p4765070.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

Reply via email to