budd@arizona.UUCP (01/11/84)
Does anybody know what the reason is for having binary messages in st-80? It seems to me that a binary message would simply be a special case of message, and won't require making exceptions for. This would also simplify parsing. So far I haven't found any situations where binary messages differ from ordinary messages, other than in parsing.
doug@hcr.UUCP (Doug Moen) (01/14/84)
Binary messages are provided in St-80 purely as a matter of "syntactic sugar". It's more convenient to type a * b + c than (a times: b) plus: c The current scheme of having 3 classes of messages, each with a different syntax, was actually introduced in Smalltalk-76. I've been told that, at the time, Alan Kay claimed that this was only a temporary measure, until they could come up with a more elegant syntax. Prior to this (in Smalltalk 72), messages were effectively free-format. A message could be defined as any sequence of parameters and selectors. The catch was that messages had to be parsed at run-time, by code in the class definition. Although this was supremely flexible, it slowed things down, and worse, led to hard-to-read code, and strange bugs, when an expression was parsed in a manner unintended by the programmer.
rentsch@unc.UUCP (Tim Rentsch) (01/15/84)
Binary messages are useful (in my opinion) because (1) they are convenient notationally (wouldn't you rather say a+b than a plus: b ?) and therefore (2) they simplify the resultant code (as in 0 to: i-1 do: [...] is better than 0 to: ( i minus: 1 ) do: [ ... ] ). They feel natural, allow "normal" arithmetic expressions, and result in a comfortable number of precedence levels (three seems about right, with 1 certainly too few, and 6 too many). Not necessary, no; natural, handy, useful, uncomplicated, yes.