News for hackers. Stuff that matters.
Re:Strangest Language Features by grogs on Thursday December 15, 2011 @07:54PM (#3358847)
I've missed this feature in other languages.

Now I have a name, the cascades operator.

I don't think the syntax is especially elegant/readable, though.

Re:Strangest Language Features by gnaritas on Thursday December 15, 2011 @09:45PM (#3359170)
It's extremely elegant and readable, when done idiomatically.

  list := OrderedCollection new
            add: 1;
            add: 2;
            add: 3;
            yourself
There's actually a literal syntax for Arrays, but the above example applies to all code and is used heavily in constructors and anything using a builder pattern.
Re:Strangest Language Features by masklinn on Friday December 16, 2011 @04:09AM (#3360089)
> There's actually a literal syntax for Arrays

Much in the same way as Java, smalltalk-80's arrays are not the most useful thing (they're significantly worse than Java's if I remember correctly, as you can only put other literals in them). So most collections in "user" code are not going to be arrays.

I believe gnu smalltalk extends arrays to be more useful (and adds other collection literals).

Re:Strangest Language Features by gnaritas on Friday December 16, 2011 @11:17AM (#3361076)
> as you can only put other literals in them

What? That's not even close to true. You are misunderstanding something. Actually, I see I think the issue... most Smalltalks have progressed a bit since Smalltalk 80 and now have a fully functional array literal syntax whereas you're talking about the very restrictive original syntax from decades ago.

Re:Strangest Language Features by masklinn on Saturday December 17, 2011 @04:26AM (#3363886)
> Actually, I see I think the issue... most Smalltalks have progressed a bit since Smalltalk 80 and now have a fully functional array literal syntax whereas you're talking about the very restrictive original syntax from decades ago.

I'm talking about Smalltalk-80, hence specifying it, but I know Dolphin Smalltalk still has that restriction.

Re:Strangest Language Features by gnaritas on Saturday December 17, 2011 @09:19PM (#3365694)
Well I brought up the Array literals in the context of modern Smalltalk; it makes little sense to respond to that by criticizing a decades old version of Smalltalk. Dolphin is a virtually dead Smalltalk, died officially a while back and was then resurrected, but it's hardly the model of a modern Smalltalk anymore. Visual Works, Pharo, Squeak, and Gemstone are modern Smalltalk's and all have a fully functional array literal syntax.