[squeak-dev] Object>>className

Chris Muller asqueaker at gmail.com
Thu Mar 23 22:10:37 UTC 2017


Hi Eliot,

Object>>#name is a travesty, but #className seems perfectly
reasonable.  Did you notice the comment of the method?  -- it has
nothing to do with "is" testing, but for accessing the type names of
objects for a list, useful for presenting a list classes which could be
the receiver for constructor of more objects.

I have overrides of #className in some of the Ma Serializer classes,
it's never presented any headache for me at all.

> e.g. when one tries to do "create inst var accessors" for a class that one has
> added a className inst var?

Honestly, dude, THAT is what irritated you enough to want to delete
this 17 year old method?  A special-case of a special-case?

I would rather get rid of "create inst var accessors" altogether, then
you would not have that problem.   :)

I don't really see any problem with #className, and easily presenting
the types of objects in a list is very feasible thing to want to do.

-1

On Thu, Mar 23, 2017 at 4:08 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> Hi All,
>
>     I find Object>>#className offensive; is methods are far nicer than this
> nonsense.  First of all  className is implemented in several Monticello
> classes to do what you'd expect; answer the name of a class of some
> to-be-imported item such as a method or class definition.  Second, there are
> tests out there that simply don't do what a naive reading might expect:
>
> testClassCommentAnnotation
> | annotation |
> browser selectSystemCategory: browser class category.
> browser selectClass: browser class.
> annotation := browser annotationForClassCommentFor: browser class.
> self assert: (annotation includesSubstring: browser class organization
> commentStamp).
> self assert: (annotation includesSubstring: 'class comment for').
> self assert: (annotation includesSubstring: browser className).
>
> Is it /really/ that hard to write foo class name instead of foo className
> and have subclasses prevented from using it easily e.g. when one tries to do
> "create inst var accessors" for a class that one has added a className inst
> var?  We already have Object>>#name, which is horrible enough.  Ca we think
> seriously about nuking Object>>#className?
>
> The grouch.
> _,,,^..^,,,_
> best, Eliot
>
>
>


More information about the Squeak-dev mailing list