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 sequences.generalizations hashtables kernel
5 locals locals.backend macros make math parser sequences ;
8 MACRO: shuffle-effect ( effect -- )
9 [ out>> ] [ in>> H{ } zip-index-as ] bi
11 [ nip assoc-size , \ narray , ]
12 [ [ at \ swap \ nth [ ] 3sequence ] curry map , \ cleave , ] 2bi
16 ")" parse-effect suffix! \ shuffle-effect suffix! ;
18 : tuck ( x y -- y x y ) swap over ; inline deprecated
20 : spin ( x y z -- z y x ) swap rot ; inline deprecated
22 : roll ( x y z t -- y z t x ) [ rot ] dip swap ; inline deprecated
24 : -roll ( x y z t -- t x y z ) swap [ -rot ] dip ; inline deprecated
26 : 2swap ( x y z t -- z t x y ) 2 2 mnswap ; inline