I was in the need of a "unique" word which, given a sequence, builds a
new sequence of the same kind with unique elements of the input
sequence while keeping the same order (only subsequent duplicate
elements must be ommited). I ended up with:
: unique ( seq -- newseq )
[
dup length <vector> tuck
dup [ member? not ] curry
swap [ push-if ] curry curry each
] keep like ;
Is that an abuse of curry (three of them?) How would you write it?
Sam
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk