Hi Vaidotas,
all of the things that you suggest are possible, and I would encourage to you experiment and see what makes sense to you. But I would caution agaist changing well-known method names unnecessarily, sometimes it is better to just improve the method comment to reduce surprises.
I don't know your level of experience, but a VM primitive that finds all (immediate) instances of Character would be an interesting exercise if you have an interest in that area. To be clear, it's not something that I would want to spend time on myself, but I'm happy to help you learn how to do it yourself if you have an interest.
Dave
On Sat, Feb 29, 2020 at 10:11:38PM +0200, Vaidotas Did??balis wrote:
David and Subbu, Thank you for your explanations, but ... but we have characters in the image. Having a characters in the image means that Character has instances. If alInstances method cannot report about them, it shall fire exception perhaps, or, name allInstances must be changed to something else, isn't it? regards, Vaidotas
On Sat, Feb 29, 2020 at 10:33 AM K K Subbu kksubbu.ml@gmail.com wrote:
On 29/02/20 12:26 AM, Vaidotas Did??balis wrote:
Hello, Character allInstances size=0. Why?
Good observation!
allInstances gives a list of objects of the given class stored in Object Memory. Character and SmallInteger are immediate values (type 7), stored directly in an oop, so they have no instances in Object Memory. You get other such types with:
Class allSubInstances select: [:c | c instSpec = 7] an OrderedCollection(SmallInteger SmallFloat64 Character)
See the comment of Behavior>>instSpec for other instance types.
HTH .. Subbu _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners