binary selectors ambiguity and space
Dan Ingalls
Dan at SqueakLand.org
Wed May 17 15:06:57 UTC 2006
Wolfgang Helbig <helbig at Lehre.BA-Stuttgart.DE> wrote...
>you explained:
>>Well, the *idea* was that you should not need spaces, and St-76,
>>borrowing from
>>APL, had a different character for the semantically different high-minus sign
>
>What's so bad about needing spaces? After all, the space key is one of the
>easiest to hit :-). And spaces are already required as separators between
>keywords and argument names, aren't they?. It seems quite natural to require
>spaces as separators between a binary selector and a "special character" like
>minus.
>
>Then you could get rid of the special treatment of the minus
>character. That is,
>the minus character would be allowed as a second character of a
>binary selector.
I think we've pretty much exhausted this topic, but I did want to
respond to your query.
What is so bad about needing spaces?
Truth is, I think it's probably the best solution to the ambiguity.
It happens so infrequently that it's not a problem for people who
want no spaces, and it has the nice effect that anyone who *doesn't
yet know* the rule will intuitively know the parse (this is my one
objection to the current state of affairs -- it fairly radiates
ambiguity). But I also don't want to rock the boat and, as I get
older, that seems to be more of a problem (literally and figuratively
;-).
Now the other side of your question, which I take to be
Why do you want to write expressions without spaces?
This is a stylistic thing and it truly varies for me depending on
what kind of code I am writing. I like to be able to write "a+1"
with no spaces when I think of it (and want the reader to see it) as
effectively a single symbol. Other times I want the reader to think
about the fact that we add one here, and then I write "a + 1". I
like having the choice between these two modes of expression, and
that's why I want to be able to leave out the spaces.
- Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060517/e18bfa8d/attachment.htm
More information about the Squeak-dev
mailing list
|