[squeak-dev] SkipList

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] SkipList

Nicolas Cellier-3
I was looking how to correct http://bugs.squeak.org/view.php?id=6778 .
Not that easy given structure of SkipList...

But first, I would like to understand something.
Why this:

        | sk |
        sk := SkipList new.
        sk at: 3 put: '3333'.
        sk at: 3 put: '666'.
        self assert: (sk at: 3) = '3333'.

It works, I mean sk is silently ignoring my second #at:put: request.
Any reason for such a behavior?

And my second question, anyone ever used SkipList?

Nicolas


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: SkipList

Nicolas Cellier-3
The fact that SkipList does not raise great interest is a good clue...
Anyone to disagree that it is a good candidate for removal from Kernel?
(like what happened to MappedCollection).

Nicolas

nicolas cellier a écrit :

> I was looking how to correct http://bugs.squeak.org/view.php?id=6778 .
> Not that easy given structure of SkipList...
>
> But first, I would like to understand something.
> Why this:
>
>     | sk |
>     sk := SkipList new.
>     sk at: 3 put: '3333'.
>     sk at: 3 put: '666'.
>     self assert: (sk at: 3) = '3333'.
>
> It works, I mean sk is silently ignoring my second #at:put: request.
> Any reason for such a behavior?
>
> And my second question, anyone ever used SkipList?
>
> Nicolas
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: SkipList

Tapple Gao
On Thu, Mar 27, 2008 at 10:15:49PM +0100, nicolas cellier wrote:
> The fact that SkipList does not raise great interest is a good clue...
> Anyone to disagree that it is a good candidate for removal from Kernel?
> (like what happened to MappedCollection).

Looking at what it is, perhaps it should be merged into
SortedCollection

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: SkipList

Ken Causey-3
In reply to this post by Nicolas Cellier-3
That's a bit extreme.  Just because I was not sufficiently interested in
replying to your reply does not mean I might not want to use it some
day.

The initial reason that SkipList>>at:put: does not replace the existing
definition is that it is implemented by calling
SkipList>>at:put:ifPresent: with an empty block.  So when an existing
value is found it is silently ignored.

http://en.wikipedia.org/wiki/Skip_list

I don't have time right now to investigate but I suspect that since this
was pretty clearly intentionally implemented this way that there is a
good reason for it.  The point is that it's not clear to me that what
you are reporting is a bug.

Ken

P.S.  I should clarify that I'm not opposed to things being removed.
But they should not simply be deleted.  Removing to an external package
is an option but one that might be best deferred until there is someone
interested in actually maintaining such a package.

On Thu, 2008-03-27 at 22:15 +0100, nicolas cellier wrote:

> The fact that SkipList does not raise great interest is a good clue...
> Anyone to disagree that it is a good candidate for removal from Kernel?
> (like what happened to MappedCollection).
>
> Nicolas
>
> nicolas cellier a écrit :
> > I was looking how to correct http://bugs.squeak.org/view.php?id=6778 .
> > Not that easy given structure of SkipList...
> >
> > But first, I would like to understand something.
> > Why this:
> >
> >     | sk |
> >     sk := SkipList new.
> >     sk at: 3 put: '3333'.
> >     sk at: 3 put: '666'.
> >     self assert: (sk at: 3) = '3333'.
> >
> > It works, I mean sk is silently ignoring my second #at:put: request.
> > Any reason for such a behavior?
> >
> > And my second question, anyone ever used SkipList?
> >
> > Nicolas
> >
>
>
>



signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: SkipList

Maurice Rabb
In reply to this post by Tapple Gao
While SkipLists have many wonderful properties, they are needlessly  
complication for simple a sorted list.  I would vote for  
SortedCollection to remain uncomplicated.  Perhaps SkipLists can be  
removed into a separate package.

-Maurice

On Mar 27, 2008, at 16:50 , Matthew Fulmer wrote:

> On Thu, Mar 27, 2008 at 10:15:49PM +0100, nicolas cellier wrote:
>> The fact that SkipList does not raise great interest is a good  
>> clue...
>> Anyone to disagree that it is a good candidate for removal from  
>> Kernel?
>> (like what happened to MappedCollection).
>
> Looking at what it is, perhaps it should be merged into
> SortedCollection
>
> --
> Matthew Fulmer -- http://mtfulmer.wordpress.com/
>


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: SkipList

Nicolas Cellier-3
In reply to this post by Ken Causey-3
Ken Causey a écrit :
> That's a bit extreme.  Just because I was not sufficiently interested in
> replying to your reply does not mean I might not want to use it some
> day.
>

At least I fot a reaction :)

> The initial reason that SkipList>>at:put: does not replace the existing
> definition is that it is implemented by calling
> SkipList>>at:put:ifPresent: with an empty block.  So when an existing
> value is found it is silently ignored.
>
> http://en.wikipedia.org/wiki/Skip_list
>
> I don't have time right now to investigate but I suspect that since this
> was pretty clearly intentionally implemented this way that there is a
> good reason for it.  The point is that it's not clear to me that what
> you are reporting is a bug.
>

I do not call it a bug, because I saw the feature in the SUnit.
But I would precisely like to know the reasons behind.
Because I find the feature annoying.
It does not behave like other collections, and this is surprising for
some class aiming to reach the holly Kernel collections.


> Ken
>
> P.S.  I should clarify that I'm not opposed to things being removed.
> But they should not simply be deleted.  Removing to an external package
> is an option but one that might be best deferred until there is someone
> interested in actually maintaining such a package.
>

Of course, put on squeaksource and refer with SqueakMap with appropriate
license from the authors.