Order of precedence

Ian Bicking bickiia at earlham.edu
Wed Jan 27 03:45:53 UTC 1999


In message Tue, 26 Jan 1999 09:38:32 -0800,
  glenn <krasner at objectshare.com>  writes:
> 	c) cater to adults and children already computer-skilled who have
> preconceived notions set by some other computer languages which have
> multiple rules, one operator-based and the other left-to-right (or
> right-to-left or some such).

I'm not saying that the normal, mathematical rules of precedence are easier
for children.  Quite the contrary -- Smalltalk's simple left-to-right rule
is much more intuitive.  This is the problem.  A child who is introduced to
Smalltalk's system would likely have their intuition reinforced, making it
all the harder to learn the proper (mathematical notation) rules of
precedence.

The fact of the matter is, mathematics says that 3+4*5=23.  You can't change
that -- the mathematical conventions of the world are not going to be
changed because they are easier for the computer to parse.  In a practical
matter, those conventions have been created because they *are* easier to
parse (for humans) in real-world situations.  They lead to less parenthesis.
They group factors.  They *are* aesthetic.

Perhaps the real answer is to have a view of Squeak where the syntax is
fully mathematical.  Where 3*sin(x^2+2) works.  In this view a child could
learn mathematics.  But it seems that a better solution could be made, one
that encompasses both needs (simplicity and conformity) instead of requiring
a break-away syntax.

I bring this up because I've been looking at Logo, and one of the big
compromises they made in the syntax was to allow infix notation even though
it wasn't part of the Lisp tradition and sullied the syntax quite a bit.

Now, this is all assuming that a goal of Squeak (distinct from Smalltalk)
is as a pedagogical tool.  This is by no means necessarily true... though
it would be neat if Squeak could be used by children, that doesn't mean it
needs to be created for them to learn from it (though, of course, it is
impossible to seperate use from learning).  Pedagogically, introducing
something that looks almost like proper mathematical expressions but isn't
is a bad thing to do.  This is one reason (not necessarily a huge reason)
that I don't think Squeak is ready for children.


                                       -- Ian Bicking





More information about the Squeak-dev mailing list