Dot notation and a crazy idea
Ivan Tomek
ivan.tomek at acadiau.ca
Thu Mar 18 18:46:07 UTC 1999
While the notation is interesting and arguably easier to read, I am
worried that it adds new constructs to the syntax. One of the great
features of Smalltalk is its minimal syntax.
Date forwarded: 18 Mar 1999 17:47:52 -0000
Date sent: Thu, 18 Mar 1999 09:43:35 -0800
From: Jerome.Garcia at wj.com (Jerome Garcia)
Subject: Re: Dot notation and a crazy idea
To: squeak at cs.uiuc.edu, Marcel Weiher <marcel at system.de>
Copies to: <cohenb at gemstone.com>
Forwarded by: squeak at cs.uiuc.edu
Send reply to: squeak at cs.uiuc.edu
>
> On 3/18/99 Marcel Weiher wrote:
>
> >
> <crazy-idea>
>
> In fact, the whole business of refering to objects via name is
> really just a special case of selection. Which object do you want?
> The one named 'bert'.
>
> Let's generalize this back to saying that a dotted name is really a
> select statement. So we could have something like:
>
> customers.[ name == 'Kay' ].name capitalize.
>
> instead of
>
> customers select: [ :each | each name == 'Kay' ] do: [ :each
> | each name capitalize ].
>
> with the square-brackets thingy in the dotted path being a
> simplified block, though maybe a full block would be better. (Then
> again, why shouldn't both types co-exist?)
>
> Add multiple method returns ( 'sendback' ), and ... wow! Certainly
> all sorts of 'generate-and-test' programs become one-liners.
>
> </crazy-idea>
> >
>
>
> I love this crazy-idea. It results in code which is both more readable
> and more concise.
>
> Jerome
>
Ivan Tomek,
Jodrey School of Computer Science
Acadia University
Nova Scotia, Canada
fax: (902) 585-1067
voice: (902) 585-1467
Life would be so much easier if we could just look at the source code.
Go Smalltalk.
More information about the Squeak-dev
mailing list
|