Hello,

This is your subset:

----------------------------------------------------------------------
: push-if ( elt quot accum -- )
    >r keep r> rot [ push ] [ 2drop ] if  ; inline

: pusher ( quot -- quot accum )
    V{ } clone [ [ push-if ] 2curry ] keep ; inline

: subset ( seq quot -- subseq )
    over >r pusher >r each r> r> like ; inline
----------------------------------------------------------------------

This is your subset on fry:

----------------------------------------------------------------------
: (subset) ( vec seq quot -- vec ) '[ dup @ [ push ] [ drop ] if ] each ;

: subset ( seq quot -- seq ) V{ } clone -rot (subset) ;
----------------------------------------------------------------------

Any questions?

Ed

http://youtube.com/watch?v=nl5gBJGnaXs

http://www.usdoj.gov/ndic/pubs11/12208/index.htm

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to