Jan. 8, 2011
10:07 p.m.
2011/1/8 Stephan Eggermont <stephan@stack.nl>:
Nicolas wrote:
Then group the selectors (first, first: etc..), explain that they are extensions, and don't need a copy prefix, because anyway most messages will do a copy.
You are aware first doesn't copy, do you? The explanation should be that you always have to take a look at the implementation to see if it copies or not (or sometimes), and explain when it doesn't matter (small integers, characters).
Stephan
You mean something like: | collec | collec := #('foo' 'bar'). shallowCopy := collec copy. self assert: collec first == shallowCopy first Well, yes those copies are shallow, but what's the difference between copy, copyFrom:to: first, first: etc... with this respect ? Nicolas