On 19 April 2010 15:20, Schwab,Wilhelm K <[email protected]> wrote: > Sig, > > Lack of precedence *is* a weakness of the language and ridiculing someone who > cites it won't help anything. IMHO, the best response we have is that > consistency is among Smalltalk's great strengths, and arithmetic precedence > was and remains a deliberate casualty of that design goal. I am not saying > we should change the situation, but grant the point. > > If the other side is not willing to accept an extra set of parentheses here > and there in the name of consistency, you might subsequently try pointing out > that a nice mix is to do logic, memory management and GUI implementation in > Smalltalk and to do number crunching in C++ with the functions exposed as > extern "C". Not only is it faster than a pure-Smalltalk solution, the > equations translate much as one exects, and C's memory management woes are > largely irrelevant. > > Precedence was indeed a pain to learn as a child, but we all did learn it, > and the best of us will at times get bitten when the compter does not "know" > those same rules. The trick, is to respectfully challenge people to try this > wonderful system that is nice enough on balance to get people to re-think > arithmetic - or at least pitch it that way. >
the thing is, that smalltalk expression a+b*c not necessary related to arithmetics. I could create own class with #+ and #* selectors which can do anything i want, doing things way different to be any kind of math. Also, in a school terms, a precedence rules is defined for very small set of operators, while in smalltalk we could define a new one at any time using binary selector syntax. Now imagine, that each time you creating a new operator, you must a) define its precedence b) remember how to use it. Now think, how hard it would be for someone to read your code and understand the semantics, since he doesn't knows what precedence you are defined for new operator(s). Another problem that if you defining a new operator and its precedence, a precedence tends to be globally applied. Now what you would do, if you filing in the code, in which a precedence for some operators doesn't matching the precedence of those, which already in image? Also, mathematicians using different kinds of algebras for different domains, and defining different and weird looking operators in that algebras. So, that's why i think its completely pointless to even think about supporting precedence rules in smalltalk, by breaking its uniform and _simple_ syntax rules. > Bill > > > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
