Optional Typing / Syntax (was: RE: Animorphic ST (Strongtalk) released!)

Stephen Pair spair at acm.org
Mon Jul 22 14:01:52 UTC 2002


Gilad Bracha wrote:
> >but I would hope that some better syntax can be found than
> >is currently in both StrongTalk and SmallScript.
> 
> I don't argue with people over surface syntax. It is a highly 
> emotional and 
> subjective issue for people, even though it is fundamentally 
> trivial. I 
> will note that we had to retrofit a syntax that parsed, onto 
> the existing 
> Smalltalk syntax. This constrains things a good deal. Feel 
> free to suggest 
> concrete improvements.

Why do we need to change the Smalltalk syntax at all?  In fact, I'd
argue that the optional type annotation isn't all that optional.  It's
optional for the author, but not optional for the reader.

What I'd prefer is type annotation that happens outside the source of a
method.  Methods could have a "MethodTypeSignature" (or similar) that is
attached to them that a Browser could use/create at will.  The Browser
would have an enhanced UI for creating and modifying the type signature
of a method (which could optionally insert annotations directly into the
displayed source code).  Browsers could use the type signature for
auto-completion.  For file-outs, the type signature of a method would
have a simple text based instance creation mechanism that would be
attached to a method.

In a system like this, the Smalltalk syntax does not need to change at
all, enhanced browsers can make use of type information if present, and
it is truly optional (for both the author and the reader).

- Stephen




More information about the Squeak-dev mailing list