On Nov 23, 2007, at 7:46 AM, Waldemar Kornewald wrote:
It's our familiarity with math, not a programming language.
Am I the only one who has to work a lot with math? Maybe that explains
why you don't want to understand my problem.
I can't say which side of this argument is 'right' -- assuming either
of them is. (I know which side is right for me, but that's a
different matter.) But here's my idle observation: objects and
messages know nothing about math.
By (effectively arbitrary) convention (embodied as parsing rules)
there are three ways of parsing symbols when used as selectors:
message names with no arguments, names with one or more arguments,
and everything else which (by convention only) expects a single
argument. Buried deep in some library somewhere (far from intrinsic
object-message implementation) are some declarations that say a
particular pattern of bits will respond to an 'everything else' type
message by combining itself with the pattern of bits presented as an
argument to produce another pattern of bits. Looking at them in just
the right way might convince you that in fact the last pattern was
the 'sum' of the first two patterns -- but this is a very specific
interpretation and is neither implied by nor required by the
underlying general mechanism of sending messages to objects. Another
very specific interpretation for a different 'everything else'
message is that the third pattern of bits is the 'product' of the
first two. The objects are not numbers and the messages are not
mathematical operators -- they're just interpretations that model
those concepts from the real world within the more general and less
complex object/message world.
There are circumstances where these specific interpretations are so
pervasive that it makes sense to intimately relate the models with
the concepts from the real world. One example is in constructing
programming languages where I would DESPERATELY like '+', '*' and '?'
to be postfix unary operators, and '!' and '&' to be prefix unary
operators. It would make my life a lot easier. But, it would
detract from the generality of the object system to create this finer
structure within the (almost defensible) three-level unary/binary/
keyword taxonomy.
I believe the same holds for mathematical code.
I'm willing to share some of my 'language operators' with the 'math
guys', and the place I'll 'meet them in the middle' is at the simple,
three-level message name taxonomy. When it gets too much for me to
bear, I will (any day now ;-) just put my parser into a mood where [!
&*+?] behave like unary selectors for the duration of my 'language
hacker' declarations. I'd expect the math guys (when it gets too
much to bear) will create finer distinctions of precedence to make [*/
%] bind more tightly than [+-] in their number-crunching algorithms.
If we were to play the reductio ad absurdum game we'd have 'x add: y
multiply: z' parsed as two binary messages with #multiply: higher
precedence than #add:. (Where would that leave #soustraire:?
#menos:? ;-)
Cheers,
Ian
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc