Squeak (ST80) syntax
Alan Knight
knight at acm.org
Wed Feb 16 13:35:08 UTC 2000
At 04:33 AM 2/16/00 -0800, David M.Siegel wrote:
>Dan Ingalls wrote:
>
> > Such inclusions are often called "noise words", and several successful
> languages have used them. I dislike them for two reasons that amount to
> the same thing:
> >
> > 1. In an extensible language like Squeak, you are either
> > eliminating aspects of the extension (like "you must not
> > use 'bits' (and how many other words) as unary messages",
> > or, you are inviting chaos when someone does this.
> >
> > 2. I just think that the presence of words that don't mean
> > anything, turns what should be mathematics into mush.
> > Another similar example to which I am even more opposed
> > is, when a variable C is bound to a collection with only one
> > element, why not (as a "convenience"), allow the user to
> > refer to that element by saying 'C' instead of 'C first'?
>
>I like a terminating keyword for cases where it improves readability.
>Seems to me, the problem is distinguishing a terminating keyword from
>a unary message. What if we made the terminating keyword required?
>That is, if it's part of the message, it's required.
>In other words, a sample selector might be #arg1:arg2:terminator.
That doesn't help the readability case. How do I distinguish
aFoo arg1: 3 arg2: 7 terminator.
from
aFoo arg1: 3 arg2: 7 rounded.
I have to know what the selectors defined for Foo are. What if both
arg1:arg2: and arg1:arg2:terminator are defined.
I think you want some degree of special syntax if you're going to allow
something like this. Here's a not-thought-about-too-hard proposal. What
about special punctuation of a leading colon. That sort of fits with the
message send syntax, and isn't ambiguous with too much else except variable
declaration, which is pretty clearly happening in other contexts. So, e.g.
aFoo arg1: 3 arg2: 7 :terminator.
or, a (slightly) more sensible example
aPoint transformBy: 3 at 7@4 :usingLeftHandedCoordinates.
--
Alan Knight [|] knight at acm.org
The Object People 613.225.8812(v) 613.225.5943(f)
"Never give up; and never, under any circumstances, no matter what -- never
face the facts"
- Ruth Gordon
More information about the Squeak-dev
mailing list
|