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 fry
4 generalizations kernel macros make sequences
5 sequences.generalizations ;
8 MACRO: shuffle-effect ( effect -- quot )
9 [ in>> H{ } zip-index-as ] [ out>> ] bi
10 [ drop assoc-size '[ _ narray ] ]
11 [ [ of '[ _ swap nth ] ] with map ] 2bi
15 ")" parse-effect suffix! \ shuffle-effect suffix! ;
17 : spin ( x y z -- z y x ) swap rot ; inline deprecated
19 : 2swap ( x y z t -- z t x y ) 2 2 mnswap ; inline