[squeak-dev] The Trunk: EToys-topa.123.mcz
Eliot Miranda
eliot.miranda at gmail.com
Wed Apr 8 17:50:11 UTC 2015
On Wed, Apr 8, 2015 at 1:09 AM, Tobias Pape <Das.Linux at gmx.de> wrote:
> Hi Eliot
>
> On 08.04.2015, at 09:56, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
> > Hi Tobias,
> >
> > hasClassNamed: and symbols are to be preferred to avoid the cost of
> interning.
>
> I don't quite understand that. When I use a symbol, it already has been
> interned,
> either during method-compilation or because I created it. How is interning
> avoided here?
> I thought this was the very reason to not pass a Symbol to hasClassNamed?
> What about its sibling classNamed: (or classOrTraitNamed:)?
>
> > The class name keys are, as they should be, symbols, and we don't want
> to pay the cost of interning to do that lookup. And I agree with Levente
> that symbols are searched for when SystemNavigation is used to find such
> soft class references.
>
> Right, I did not argue against that :)
>
I misunderstood. So this discussion is just about the argument name? In
any case I'm with Bert for using symbols to refer to class names whereever
possible.
>
> > Your string position is understandable but needlessly expensive. The
> use of symbols (and the assumption that they're strings) is simple and
> efficient.
>
> Don't get me wrong, I think that this assumption is worthwhile in (at
> least)
> Core Squeak, yes.
>
> Best
> -Tobias :)
>
> >
> > Eliot (phone)
> >
> > On Apr 7, 2015, at 8:21 AM, Tobias Pape <Das.Linux at gmx.de> wrote:
> >
> >>
> >> On 07.04.2015, at 17:16, Levente Uzonyi <leves at elte.hu> wrote:
> >>
> >>> What's wrong with #hasClassNamed:?
> >>
> >> From my POV, it takes a String, and we wanted a symbol here ;)
> >> Also, I wanted t be conisten with #setUP
> >>
> >>>
> >>> Levente
> >>>
> >>> On Tue, 7 Apr 2015, commits at source.squeak.org wrote:
> >>>
> >>>> Tobias Pape uploaded a new version of EToys to project The Trunk:
> >>>> http://source.squeak.org/trunk/EToys-topa.123.mcz
> >>>>
> >>>> ==================== Summary ====================
> >>>>
> >>>> Name: EToys-topa.123
> >>>> Author: topa
> >>>> Time: 7 April 2015, 2:37:32.593 pm
> >>>> UUID: 71b565ae-57ad-4d33-91d2-d6bfeec75490
> >>>> Ancestors: EToys-topa.122
> >>>>
> >>>> the ifPresent: part needs a block argument
> >>>>
> >>>> =============== Diff against EToys-topa.122 ===============
> >>>>
> >>>> Item was changed:
> >>>> ----- Method: TileMorphTest>>expectedFailures (in category 'testing')
> -----
> >>>> expectedFailures
> >>>>
> >>>> ^ super expectedFailures,
> >>>> (self class environment
> >>>> at: #BaseSoundSystem
> >>>> + ifPresent: [:e| #()]
> >>>> - ifPresent: [#()]
> >>>> ifAbsent: [#(testSoundTile) "Only this test depends on
> Sound"])!
>
>
>
>
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20150408/1eccfb7d/attachment.htm
More information about the Squeak-dev
mailing list
|