[Glass] Is there a less hacky way of getting indexes of an unordered collection?

Mariano Martinez Peck via Glass glass at lists.gemtalksystems.com
Fri Jun 12 14:12:11 PDT 2015


OK...I found #getIndexInfo. Was difficult to find since it is in protocol
'Repository Conversion'.

Thanks,

On Fri, Jun 12, 2015 at 6:05 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

> I had to implement such an extension method:
>
> getCurrentIndexes
> | result iList |
> result := OrderedCollection new.
> iList := self _indexedPaths.
> iList == nil
>   ifFalse: [
>     2 to: iList size by: 2 do: [ :i |
>       (iList at: i) > 0 ifTrue: [ result add: (iList at: i - 1) ]
>     ]
>   ].
> ^ result
>
> But it seems a bit hacky and cryptic. I am using GemStone 3.1.0.6.
>
> Thanks!
>
> --
> Mariano
> http://marianopeck.wordpress.com
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150612/ba55a880/attachment.html>


More information about the Glass mailing list