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 -- )
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 : tuck ( x y -- y x y ) swap over ; inline deprecated
19 : spin ( x y z -- z y x ) swap rot ; inline deprecated
21 : roll ( x y z t -- y z t x ) [ rot ] dip swap ; inline deprecated
23 : -roll ( x y z t -- t x y z ) swap [ -rot ] dip ; inline deprecated
25 : 2swap ( x y z t -- z t x y ) 2 2 mnswap ; inline