Hi Factor list,

I wrote this today after being surprised that it wasn't in the sequences 
vocab:

: (indexes) ( obj seq n -- )
   [ 2dup ] dip swap index-from [ dup , 1+ (indexes) ] [ 2drop ] if* ;

: indexes ( obj seq -- idxseq )
   [ 0 (indexes) ] { } make ;

It returns indexes to all occurrences of obj in seq. Have I missed this 
implemented somewhere else, or shall I add it to sequences?

Thanks,

Phil


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to