pipe
Alan Lovejoy
squeak-dev.sourcery at forum-mail.net
Tue Aug 28 11:38:48 UTC 2007
Denis Kudriashov wrote:
>
> 2007/8/27, Alan Lovejoy <squeak-dev.sourcery at forum-mail.net
> <mailto:squeak-dev.sourcery at forum-mail.net>>:
>
> There haven't been all that many syntax changes to Smalltalk since its
> public release as ST80. Off the top of my head, I can list the
> following:
>
>
> These changes does not have an influence on language core, language
> semantics. Its just was some convenient constructions for building
> special objects. But when we put in Smalltalk new operator we change
> it semantics. Why we must do it?
> Bert implemented it in clean Smalltalk without any language changes.
> Why it is not enough?
>
There are two issues:
1) Are the proposed "pipes" a good idea at all? Is it good programming
style--or an abusive practice?
2) If pipes are good style, is it better to implement them syntactically
(which is rarely done in Smalltalk,) or using Smalltalk's usual
implementation strategy: sending messages to objects?
There are two arguments in favor of the syntax-based implementation
(which presumes that the answer to point 1 above is that "pipes are good
style"):
1) Performance: The syntax-based implementation would be significantly
faster.
2) Code clarity: The syntax-based implementation could be made visually
much clearer, with much less probability of being wrongly interpreted by
the reader. A reader of the code would be much more likely to miss an
#asPipe message at the beginning of a sequence of message cascades, than
he would be to miss a new, well-chosen pipe operator (e.g, ":>"). The
semantics of a message cascade and a sequence of piped messages is
rather different.
Personally, I'm undecided as to whether pipes are good style, but favor
a syntax-based implementation, if pipes are to be implemented and used
at all (for the reasons above.)
--Alan
More information about the Squeak-dev
mailing list
|