[squeak-dev] Towards a more consistent and sensible implementation of #isAbstract

David T. Lewis lewis at mail.msen.com
Sun Dec 10 15:26:28 UTC 2017


On Sun, Dec 10, 2017 at 11:09:04AM +0100, Nicolas Cellier wrote:
> 2017-12-10 9:53 GMT+01:00 Marcel Taeumel <marcel.taeumel at hpi.de>:
> 
> > So it comes down to what "being abstract" actually means in the
> > environment. :-) I think it means #== considering the current VM and the
> > role of classes. Not sure in a the generic, object-oriented sense, though.
> >
> > Best,
> > Marcel
> >
> > Am 10.12.2017 00:02:06 schrieb Chris Muller <asqueaker at gmail.com>:
> > With objects you should delegate to the the receiver to decide what #=
> > means -- which in most cases will inherit that default implementation from
> > Object anyway.  Sending #== is generally bad form.
> >
> > Converting uses of #= to #== for "performance" is a bad idea except in the
> > most inner, performance-critical code, and even then, it should be with a
> > comment.
> >
> > Absolutely, if it's only for the sake of optimization, it's a bad decision.
> Not to mention that isAbstract is not performance critical at all.
> 
> Maybe the intention is to really test for identity.
> That's because we have the knowledge that classes are the unique instance
> of their metaclass.
> So using = could be seen as an un-necessary indirection.
> 
> Reducing the level of indirection may reduce complexity.
> But it is also reducing extensibility as noted by Marcel.
> 
> But do we want to elimiate complexity at all?
> I see this related to "complex versus complicated" and the original
> biological analogy.
> Are resilient/adptative systems necessarily complex?
> If so, ideally such complex system should be built from simple
> behavior/rules.
> What we want to avoid if possible is complicated things.

Is one of these two approaches less complicated and easier to understand
with respect to Environments? I don't know the answer, just asking.

Dave


> 
> Nicolas
> 
> >
> > On Thu, Dec 7, 2017 at 2:30 AM, Marcel Taeumel <marcel.taeumel at hpi.de>
> > wrote:
> >
> >> Hi, there.
> >>
> >> What are your thoughts on how to implement "MyClass class >>
> >> #isAbstract"? I think that one should always use #== and compare it to an
> >> actual class object like this:
> >>
> >> MyClass class >> #isAbstract
> >>    ^ self == MyClass
> >>
> >> At the time of writing, we have various attempts in your image. You can
> >> browse them easily:
> >>
> >>
> >> Best,
> >> Marcel
> >>
> >>
> >>
> >>
> >
> >
> >
> >

> 



More information about the Squeak-dev mailing list