First post here ... few days on Squeak ... some questions ....

Jason Johnson jason.johnson.081 at gmail.com
Sun Aug 26 18:57:52 UTC 2007


On 8/26/07, Fabio Filasieno <fabio.filasieno at gmail.com> wrote:
>
> So if you want "pipe" behavior you have it already.  The only time
> parenthesis are needed is when there is ambiguity about evaluation
> order.
>
> No you don't ...
>
> This is ugly ...
> ((( obj collect: [ :x | ....] ) filter: [:x | …] ) select: [:x | …])
>
> This is beautiful ...
> obj | collect: [ :x | ....]
>        | filter: [:x | …]
>        | select: [:x | …]

Being ugly and not existing are two very different things.  You do
have it already, you just have to use parenthesis in the cases where
it is ambiguous to the compiler.  And I don't find the pipe that
pretty as I know it as an "or" operator.

> Haskell's $ is ugly again ...
> because you would need to write backwards .... there are better ways
> (Arrows)

It's not ugly, it's exactly what you have here.  The difference is
Haskell binds right to left and Smalltalk left to right.  Well
actually Haskell binds left to right in things like Monads and right
to left in statements.

> Why on hell I have to read from right to left ....

Because the last function called is the first thing in the statement.
This is exactly the opposite of Smalltalk, which is why the
application order is reversed.

> There is quite some redundancy - as I stated before - when the method
> returns self.
> In MY case I use the cascade on setter methods.

I don't think you read what I wrote. :)  The nice thing about the
cascade operator is that I don't have to worry what the message
returns.  I know for sure that my message sends go to the original
object.

> And for that you dump the ability to compose processes ?? You dump the power
> of UNIX ?

There are more powerful OS'es then UNIX.  And you're not talking about
the power of unix anyway, you're talking about the power of shell.
You could do the exact same thing in Windows if the utilities were
written that way (or use cygwin that *is* written that way).

> I'm not redesigning it, I'm currently writing an interpreter for a
> programming language and it happens that I selected Squeak for that ...
> I'll probably start hacking Smalltalk a little anyway ... and yes I like
> breaking Specs ... you never now. Sometimes something nice comes up ... :-)
>
> Fabio

Breaking specs is fine when it's needed, but in this case it makes no
sense.  Just add a new operator that behaves how you want.  It
shouldn't be that hard.



More information about the Squeak-dev mailing list