I would look at how Array or OrderedCollection is defined. Some objects only have instance variables, and some have instance variables and indexed slots (the so-called "variable" property of classes, perhaps better described in terms of instances being "indexable" via basicAt:/basicAt:put:). So, from what I've read so far, the problem is that the class ClassBasedCharacterArray is being defined as "non-indexable", and so you can't use new:. Now, originally, I subclassed CharacterArray because then I'd inherit useful methods such as nice printString and what not. Strictly speaking, however, any sort of "array" should do for what the book is trying to show. If you want, you can also use the NC version of VisualWorks to get the code going. Finally, one of my to-dos is to convert my implementation to use Assessments for its tests. I think it would be easier to release a sort of official version in the public Store repository then. Alas, so much to do, so little time. In the mean time, let me know if you need the MIT license to appear somewhere. Andres. On 9/26/10 14:26 , Sean P. DeNigris wrote:
Tobias Pape wrote:
try to use
ArrayedCollection variableSubclass: #ClassBasedCharacterArray instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Collections-Arrayed'
(as in Array.) As Alan Rodas points out, if the class isn't variable, #new: cannot be used.
Thanks. Where can I read about what's actually happening here? I've never heard of this alternate subclass method, and I'm running into other problems.
Sean