Hacker News new | ask | show | jobs
by pjmlp 3669 days ago
Have you ever learned Smalltalk?

Thanks to support for blocks (lambda), Smalltalk collections already had LINQ style programming, aka algorithm.h support, for example.

Nice link.

1 comments

I actually haven't ever used SmallTalk, although I understand Ruby is considerably influenced by it (blocks, as far as I understand). Any pointers are appreciated though.

I'm more of a Python person, and Python doesn't really use blocks. I like the duality mentioned this post: http://journal.stuffwithstuff.com/2013/01/13/iteration-insid... (In summary it's for item in L: f(item) vs L.each(|item| ...)

I don't really think of C++ algorithm.h as LINQ ? I guess I don't use it that much. To me that is more "functional in the small", e.g. map or filter with lambdas, vs. "functional in the large". But I'd be interested to hear more details on this analogy.

There are lots of Smalltalk books here, including the original ones from Xerox PARC.

http://stephane.ducasse.free.fr/FreeBooks.html

The best free implementations to play around are Squeak and Pharo.

http://squeak.org/

http://squeak.org/

Or if you want to avoid installing anything, Amber gives some taste of it.

http://amber-lang.net/

Now, regarding the LINQ like stuff, in Smalltalk doing this type of stuff was already possible back in those days.

    |a|
    vec := #(1 2 3 4 5 6). 
    sumPairs := (vec select: [:x | (x \\ 2) = 0]) inject: 0 into: [:l :r | l + r].
Yes, that is what I was thinking of. The other part, immutable data and such, isn't that possible to practice in large teams. But I do make use of it in personal projects.