[ENH] submorphsCleanup-efc

Chris Muller afunkyobject at yahoo.com
Tue Jul 26 14:50:15 UTC 2005


> I often use copy in default access methods. The motivation is increaed 
> robustness; it can be very risky to modify a collection.

While a read-only accessor may have its place, in *this* case, robustness is
decreased, not increased.  If you don't want to allow direct access to a
Collection, then what do you think about providing various enumerating / adding
/ removing / finding api from the containing class?

I generally disagree with having code that "cross-checks" potentially incorrect
code elsewhere.  Besides the aforementioned performance degradation, it can
inhibit learning because it allows misuse and then even increases
confusion/uncertainty about the necessity of it when you try to remedy it (just
like right now, we're all scratching our heads about this!).

>         submorphs do: [:m | ........ ifTue: [m delete]])

In this case, I think we should let anyone who tries misuse in this way learn. 
Let those who already know benefit from the increased performance of not
copying submorphs every single time we ask for it.

 - Chris



More information about the Squeak-dev mailing list