Trie in Pharo

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

Trie in Pharo

Stephan Eggermont-3
I took a look at what would be needed to port the Cuis Trie to Pharo.
Trie is a subclass of Collection, and expects at: aKey, not at: anIndex.
That breaks the EyeInspector view. What interface expects the
explorer a Collection subclass to have?

Stephan

Reply | Threaded
Open this post in threaded view
|

Re: Trie in Pharo

Sven Van Caekenberghe-2
I have mentioned this before, but EyeCollectionInspector is actually written against SequenceableCollection since it expects ordered external integer indexing. That is why currently every Collection subclass without this protocol and/or without a custom inspector fails.

The alternative would be to move Collection class>>#inspectorClass to SequenceableCollection>>#inspectorClass. Then Collection subclasses that are not SequenceableCollection and that do not have a custom inspector will fail.

Note that fail means a fall back to EyeBasicInspector.

On 25 Jul 2014, at 12:32, Stephan Eggermont <[hidden email]> wrote:

> I took a look at what would be needed to port the Cuis Trie to Pharo.
> Trie is a subclass of Collection, and expects at: aKey, not at: anIndex.
> That breaks the EyeInspector view. What interface expects the
> explorer a Collection subclass to have?
>
> Stephan
>


Reply | Threaded
Open this post in threaded view
|

Re: Trie in Pharo

Marcus Denker-4

On 25 Jul 2014, at 12:39, Sven Van Caekenberghe <[hidden email]> wrote:

> I have mentioned this before, but EyeCollectionInspector is actually written against SequenceableCollection since it expects ordered external integer indexing. That is why currently every Collection subclass without this protocol and/or without a custom inspector fails.
>
> The alternative would be to move Collection class>>#inspectorClass to SequenceableCollection>>#inspectorClass. Then Collection subclasses that are not SequenceableCollection and that do not have a custom inspector will fail.
>
> Note that fail means a fall back to EyeBasicInspector.
>

I did that change in 4.0 (with the mistake of putting #inspectorClass on the instance side of SequenceableCollection, I will fix that soon)

        Marcus
Reply | Threaded
Open this post in threaded view
|

Re: Trie in Pharo

Sven Van Caekenberghe-2

On 25 Jul 2014, at 12:55, Marcus Denker <[hidden email]> wrote:

>
> On 25 Jul 2014, at 12:39, Sven Van Caekenberghe <[hidden email]> wrote:
>
>> I have mentioned this before, but EyeCollectionInspector is actually written against SequenceableCollection since it expects ordered external integer indexing. That is why currently every Collection subclass without this protocol and/or without a custom inspector fails.
>>
>> The alternative would be to move Collection class>>#inspectorClass to SequenceableCollection>>#inspectorClass. Then Collection subclasses that are not SequenceableCollection and that do not have a custom inspector will fail.
>>
>> Note that fail means a fall back to EyeBasicInspector.
>>
>
> I did that change in 4.0 (with the mistake of putting #inspectorClass on the instance side of SequenceableCollection, I will fix that soon)
>
> Marcus

Ah, OK. Yes it is class side (I made a typo too). Don't forget to remove the selector from Collection.
Reply | Threaded
Open this post in threaded view
|

Re: Trie in Pharo

Ben Coman
In reply to this post by Marcus Denker-4
Marcus Denker wrote:
On 25 Jul 2014, at 12:39, Sven Van Caekenberghe [hidden email] wrote:

  
I have mentioned this before, but EyeCollectionInspector is actually written against SequenceableCollection since it expects ordered external integer indexing. That is why currently every Collection subclass without this protocol and/or without a custom inspector fails.

The alternative would be to move Collection class>>#inspectorClass to SequenceableCollection>>#inspectorClass. Then Collection subclasses that are not SequenceableCollection and that do not have a custom inspector will fail.

Note that fail means a fall back to EyeBasicInspector.

    

I did that change in 4.0 (with the mistake of putting #inspectorClass on the instance side of SequenceableCollection, I will fix that soon)

	Marcus

  

So EyeCollectionInspector should be called EyeSequenceableCollectionInspector ?
Reply | Threaded
Open this post in threaded view
|

Re: Trie in Pharo

Marcus Denker-4

On 25 Jul 2014, at 13:03, Ben Coman <[hidden email]> wrote:

Marcus Denker wrote:
On 25 Jul 2014, at 12:39, Sven Van Caekenberghe [hidden email] wrote:

  
I have mentioned this before, but EyeCollectionInspector is actually written against SequenceableCollection since it expects ordered external integer indexing. That is why currently every Collection subclass without this protocol and/or without a custom inspector fails.

The alternative would be to move Collection class>>#inspectorClass to SequenceableCollection>>#inspectorClass. Then Collection subclasses that are not SequenceableCollection and that do not have a custom inspector will fail.

Note that fail means a fall back to EyeBasicInspector.

    

I did that change in 4.0 (with the mistake of putting #inspectorClass on the instance side of SequenceableCollection, I will fix that soon)

	Marcus

  

So EyeCollectionInspector should be called EyeSequenceableCollectionInspector ?

yes… if it only works for those it needs to make it clear.

Marcus
Reply | Threaded
Open this post in threaded view
|

Re: Trie in Pharo

Stephan Eggermont-3
In reply to this post by Stephan Eggermont-3
Ok, thanks, that makes thing clear.

Stephan

Reply | Threaded
Open this post in threaded view
|

Re: Trie in Pharo

stepharo
In reply to this post by Stephan Eggermont-3
There are several implementation of trie. Benoit St jean did another one
and he told me that it was simpler and faster.
I have it around and I can send it to you if you need.
I was slowly going to add them to a project where I collect on
collections implementation

Stef


On 25/7/14 12:32, Stephan Eggermont wrote:
> I took a look at what would be needed to port the Cuis Trie to Pharo.
> Trie is a subclass of Collection, and expects at: aKey, not at: anIndex.
> That breaks the EyeInspector view. What interface expects the
> explorer a Collection subclass to have?
>
> Stephan
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Trie in Pharo

stepharo
In reply to this post by Stephan Eggermont-3
In StephaneDucasse/PetitsBazars
         package Box and BoxTests

contains an alternate implementation
you could add the one of cuis so that we can compare.

BXTrie is a work under progress.

Stef
> I took a look at what would be needed to port the Cuis Trie to Pharo.
> Trie is a subclass of Collection, and expects at: aKey, not at: anIndex.
> That breaks the EyeInspector view. What interface expects the
> explorer a Collection subclass to have?
>
> Stephan
>
>