[squeak-dev] Re: Ideas about sets and dictionaries
Andreas Raab
andreas.raab at gmx.de
Thu Nov 12 02:41:38 UTC 2009
Igor Stasenko wrote:
>> Seriously, how *would* you address this problem if you weren't trying to
>> make it fit exactly?
>
> err.. you don't mind, if i remind you that there a lot of ugly hacks
> around , like compact classes,
> implicit message sends (#class , #==) and nobody saying a word against
> them, #ifTrue:ifFalse: inlining
> instead of true message send and finally immediate objects -
> smallintegers which you can't subclass?!?!
>
> Do you really think that way how to represent the presence of nil in
> set worst than the listed above?
No, but that's not my point. There are reasons why the hacks you refer
to are there (performance, compactness) but we measure those tradeoffs
against a "canonical" implementation, i.e., one that does not require
these hacks. I'm trying to do the same - I am asking for how a Set with
nil would look like if you'd start it from scratch so that we can
compare and contrast between the proposals.
For example, the tradeoff in Randal's proposal (having a flag) is that
we a) add a variable to all sets (the flag) b) change the implementation
from comparing with nil to comparing with the flag and c) that Sets
cannot contain the flag element itself. That sounds quite reasonable to me.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|