[ { "a" "b" "c" "d" } ] [ { 0 1 2 3 } { "a" "b" "c" "d" } nths ] unit-test
[ { "d" "c" "b" "a" } ] [ { 3 2 1 0 } { "a" "b" "c" "d" } nths ] unit-test
[ { "d" "a" "b" "c" } ] [ { 3 0 1 2 } { "a" "b" "c" "d" } nths ] unit-test
+
+[ "dac" ] [ { 3 0 2 } "abcd" nths ] unit-test
TUPLE: bogus-hashcode ;
-! Copyright (C) 2005, 2010 Slava Pestov, Daniel Ehrenberg.
+! Copyright (C) 2005, 2011 Slava Pestov, Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel kernel.private slots.private math
math.private math.order ;
[ [ (indices) ] 2curry each-index ] keep ;
: nths ( indices seq -- seq' )
- [ nth ] curry map ;
+ [ [ nth ] curry ] keep map-as ;
: any? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
find drop >boolean ; inline