[ANSI-Smalltalk] Behaviour of #collect:
Ralph Johnson
johnson at cs.uiuc.edu
Wed Sep 24 13:20:34 BST 2008
> I find it difficult to believe that anyone ever *designed*
> Smalltalk's collection classes so that
> 'abc' collect: [:each | each codePoint]
> would drop you into the debugger.
I bet that the original authors knew it. They went out of their way
to ensure that Interval>>collect: didn't return an interval, they
could have done the same for String. But they didn't want the species
of String to be Array. So, they lived with the weakness because they
couldn't see a good way to eliminate it. If we can get rid of it
without too much cost, great!
> The simplicity that counts most is simplicity for Smalltalk *programmers*,
> not Smalltalk *implementors*.
Maybe not. See http://www.jwz.org/doc/worse-is-better.html
Simplicity for users of an abstraction is important, but simplicity of
implementors is also important. This is especially true for
Smalltalk, where users tend to learn how something works by reading
the source code. The original Smalltalk developers achieved a great
balance between simplicty of use and simplicity of implementation.
-Ralph
More information about the ANSI-Smalltalk
mailing list