Towards more standard

Stefan Matthias Aust sma at kiel.netsurf.de
Thu Dec 31 12:00:09 UTC 1998


Hi!

When moving mySelf from VisualWorks to Squeak, I noticed three problems.
Some of them could be easily fixed, some trigger greater changes.  I'd like
to discuss them.

1. VisualWorks (and other Smalltalk systems, too) accept '_' as valid
character in selectors and quoted symbols.  As Squeak uses '_' as
assignment operator, it doesn't allow them in selectors.

However Squeak also accepts ':=' as assignment operator and I wonder why
Squeak still keeps with that old syntax. Okay, you may like the old syntax
better, but IMHO the argument to stay compatible with current systems has
more weight. I'd like to at least optionally switch to the new syntax.

I've a patch which adds a flag to the scanner. If set to true, '_' are
accepted inside identifers, that is inside selectors and quoted symbols.
For compatibility, a single '_' is still taken as assignment operator.

2. Squeak doesn't allow to construct symbols from strings, using #'abc'.  

Adding this is one trivial change in the Scanner (xLitQuote) and another
one in Symbol class>>intern: to support the now possible empty symbol #''.
As this patch doesn't break any existing code, I'd really like to see this
incorporated into the base system.  I can also provide this patch file.

3. I like to use block-local temporary variables. Squeak doesn't support
this. So I had to rewrite these methods. Actually no big deal, and the
effort to add this kind of variables to the Parser is probably better spend
on true closures which then would allow them anyway.  However, it's
something one has to think about when coding for more than one dialect.

bye
--
Stefan Matthias Aust  //  Are you ready to discover the twilight zone?





More information about the Squeak-dev mailing list