[ENH] reposted: new String modifier: String>>asPlural
Peter van Rooijen
peter at vanrooijen.com
Fri Jun 11 14:15:55 UTC 2004
Alexander Lazarevic wrote:
> I think asPlural adds a stumbling block on the way to a fully localized
> squeak. The only use of asPlural by now is in Object errorNotIndexable:
> self error: self class name asPlural , ' are not indexable'
Does anyone else feel that just because we *can* extend base classes
such as String with all kinds of logic, that doesn't mean we *have* to?
The concept here seems to me to be "plural".
So, why not make a class to represent it, and get:
Plural of: self class name
This allows for other classes than String, such as Symbol, to be handled
too, and for a class comment in Plural that explains what the class does
and why, and some guidelines for how to use it, and for subclasses, and
so many other benefits. And it doesn't clutter up String with the
*logic* for pluralizing (I don't see much harm in giving it a method
#pluralForm as a convenience method).
More information about the Squeak-dev