Dot notation and a crazy idea

stan at stanheckman.com stan at stanheckman.com
Tue Mar 23 22:13:55 UTC 1999


"Donald T. Major, II" <sasdtm at unx.sas.com> writes:
> Once upon a time, Actor used to use the same shorthand syntax for
> dictionaries, and all indexed instances; instead of just a number,
> it could be other objects, including symbols, strings, etc. (literal
> or otherwise). It was available for for both a[i] and a[#fooey] :=
> 'This message brought to you by the letter "N", and the number 4.'
> As syntax went, it was actually darned convenient (as Larry Wall
> seems to have more or less discovered for Perl, though he actively
> differentiates between arrays and "hashes".)

Python uses the same. It *is* darned convenient. Compact too. But
while "just one more rule" doesn't subtract much from Perl's
simplicity, I think Squeak has more simplicity to lose.

If we someday dispose of the source file completely, saving only
comments and byte codes, then we could experiment with syntax changes
like this by just patching the interpreter and the pretty
printer. Turn on new syntax. Read existing methods in new
syntax. Write new methods in that syntax. Tire of new syntax.  Turn
off the patches. The great advantage of losing the source file is that
we could go back to reading and editing in the old format, with no
damage caused by months of work in the alternate syntax, because the
bytecodes never changed. Only the interfaces between human beings and
bytecodes did.

Maybe playing with a new syntax then reverting to an old is already
easy? I'm afraid to directly edit the sources file, but maybe there's
another way?

I think this sort of switchable syntax would largely work for testing
the proposed brackets. I suspect it wouldn't work for more complicated
changes, because those changes would cause us to write slightly
different programs. These would look good when displayed in the syntax
we wrote them in, but not so good when displayed in another
syntax. Whoever is working on the "one pretty printing to rule them
all" probably already knows more about this problem than I ever
shall. :-)

-- 
Stan





More information about the Squeak-dev mailing list