[squeak-dev] Object>>className
Eliot Miranda
eliot.miranda at gmail.com
Fri Mar 24 17:10:52 UTC 2017
Hi Chris,
On Thu, Mar 23, 2017 at 3:10 PM, Chris Muller <asqueaker at gmail.com> wrote:
> 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.
>
You miss my point. Many people complain about the proliferation of 'is'
methods, but I see them as well worth the cost. I agree that name is a
travesty and className falls in the same category for me. The issue is it
exists as a printing method but it
- collides with methods that are used to model classes and there are plenty
of them
- doesn't provide much utility as it is effectively foo class name, and foo
className saves one character.
> I have overrides of #className in some of the Ma Serializer classes,
> it's never presented any headache for me at all.
>
Except when one uses "create inst var accessors" and the getter is not
produced ;-)
>
> > 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
>
Well, each to his own.
>
> 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
> >
> >
> >
>
>
--
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170324/0465e084/attachment.html>
More information about the Squeak-dev
mailing list
|