1 ! Copyright (C) 2007 Chris Double, Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs combinators effects.parser
4 generalizations kernel sequences sequences.generalizations ;
7 MACRO: shuffle-effect ( effect -- quot )
8 [ in>> H{ } zip-index-as ] [ out>> ] bi
9 [ drop assoc-size '[ _ narray ] ]
10 [ [ of '[ _ swap nth ] ] with map ] 2bi
14 ")" parse-effect suffix! \ shuffle-effect suffix! ;
16 : 2swap ( x y z t -- z t x y ) 2 2 mnswap ; inline
18 : 2pick ( x y z t -- x y z t x y ) reach reach ; inline