pipe

Denis Kudriashov dionisiydk at gmail.com
Mon Aug 27 14:56:44 UTC 2007


2007/8/27, Bert Freudenberg <bert at freudenbergs.de>:
>
> Just for fun - the tiny attached change-set allows #asPipe to get
> piping behavior for cascades:
>
> Squeak asPipe
>         ps: 'aux';
>         grep: 'fabio';
>         sort
>
> It makes these two expressions equivalent
>
>         ((((4 + 2) * 3) + 3) * 2)
>
>         4 asPipe + 2; * 3; + 3; * 2
>
> Now I wouldn't use this in production but for interactive exploration
> it might actually be useful. Similar to implementing Symbol>>#value:
> to allow "(1 to: 10) collect: #squared".
>
> Btw, did you know each class can declare its own parser and compiler
> class? Experimenting with the syntax does not necessarily have to
> break other's stuff.
>
> - Bert -
>
>
> It's very cool.
Smalltalk is wonderfull language. We can implement any ideas without making
changes in language (as Java or C# live).
I think pipes is very usefull in DSL implementation and usage, simpler and
fast object inspecting. But long message chaines in domain code are bad
smell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070827/f0b61b62/attachment.htm


More information about the Squeak-dev mailing list