[Pharo-dev] Slot class builder: Anonymous class modification

Esteban A. Maringolo emaringolo at gmail.com
Sat Nov 23 19:20:00 EST 2013

2013/11/23 Igor Stasenko <siguctua at gmail.com>:
> On 23 November 2013 21:26, Esteban A. Maringolo <emaringolo at gmail.com>
>> >> imo, a better term to use for it would be 'private class' , because
>> >> anonymous is a bit fuzzy.

>> > I disagree.  Anonymous classes is the term that has been used for over
>> > two decades.  It means, literally, a class that has no name because it is
>> > not in Smalltalk (or in a top-level environment if the dialect has
>> > namespaces).  This is not at all fuzzy.  Private class means something quite
>> > different, a class that is private to some environment, e.g. a class nested
>> > within another class as occurs in SmalltalkAgents or Newspeak.
>> +1
>> Anonymous = without name.
>> There's not much to add to it.

> That's the point. Now what is practical implications of it?
> Think, how far you can go with anonymous versus private class.
> If you deny anonymous classes from being private,
> then you'll immediately hit many problems with tools,
> which working with public classes and expecting them to have a name.
> And i don't have to go deep to point on problems: just imagine that you did
> a change to such 'anonymous' class, now since it is public, all tools is
> notified about this change, including change logger.. and my question, what
> you going to log into .changes file in such case?

I can see your point. But then just say that "Anonymous classes are private".
Just don't change the name. Anonymous classes are a well know concept
used through piles of literature.
E.g. In Java the compiler creates anonymous classes everytime you
directly instantiate an Interface.

ej myObject.schedule(new Runnable {...});


More information about the Pharo-dev mailing list