[Newbies] Anonymous subclasses?
Hernán Morales Durand
hernan.morales at gmail.com
Sun Dec 19 18:14:57 UTC 2010
Can you comment what's your use case for anonymous subclass? Or maybe
post some example/testing code?
2010/12/18 Casey Ransberger <casey.obrien.r at gmail.com>:
> Hello all,
> I want to make an anonymous subclass, or a copy of (either way) a subclass
> of Object.
> I've been googling around looking for an example of an anonymous subclass. I
> haven't had luck with anything I've found. It's possible that there's
> something I'm missing conceptually, because I've read through various
> examples, but they all seem to do directly with Behavior or Class. I tried
> various combinations of things with both of the approaches I found. Some of
> them hung the image, with others the #primitiveChangeClassTo: would fail. I
> read the comment there, and am aware that using it is reckless behavior.
> I see that Smalltalk compactClassesArray gives me a list of the compact
> classes. I don't seem to understand the format part. I've noticed that
> certain classes (e.g. Array) are declared "variable subclasses" but that's
> it. I googled and didn't turn up anything that seemed to help me grok it.
> Class format. "answers 148" Head scratch; think. ^self shrug
> Any pointers?
> Casey Ransberger
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
Information Technology Manager,
Institute of Veterinary Genetics.
National Scientific and Technical Research Council (CONICET).
La Plata (1900), Buenos Aires, Argentina.
Telephone: +54 (0221) 421-1799.
Fax: 425-7980 or 421-1799.
More information about the Beginners