]> gitweb.factorcode.org Git - factor.git/commitdiff
use swapd in a few places.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 Jan 2014 04:30:38 +0000 (20:30 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 6 Jan 2014 04:30:38 +0000 (20:30 -0800)
basis/math/vectors/simd/intrinsics/intrinsics.factor
extra/pair-methods/pair-methods.factor
extra/rpn/rpn.factor
extra/slots/macros/macros.factor

index 97b32fd8e6b68cda94f2f61cea550984823c0eaf..03529a0f363b2fd877c10c7dfb738d87f334518a 100644 (file)
@@ -287,7 +287,7 @@ SIMD-INTRINSIC: (simd-with)              (   n rep -- v )
     underlying>> ;
 SIMD-INTRINSIC: (simd-gather-2)          ( m n rep -- v ) <rep-array> [ 2 set-firstn-unsafe ] keep underlying>> ;
 SIMD-INTRINSIC: (simd-gather-4)          ( m n o p rep -- v ) <rep-array> [ 4 set-firstn-unsafe ] keep underlying>> ;
-SIMD-INTRINSIC: (simd-select)            ( a n rep -- x ) [ swap ] dip byte>rep-array nth-unsafe ;
+SIMD-INTRINSIC: (simd-select)            ( a n rep -- x ) swapd byte>rep-array nth-unsafe ;
 
 SIMD-INTRINSIC: alien-vector     (       c-ptr n rep -- value )
     [ swap <displaced-alien> ] dip rep-size memory>byte-array ;
index 3d4e6a8fb1f7023ee75dfd7c1c3a333a76b34315..2daa8ebc0c601fc3ac451163db1fffa28441c8b2 100644 (file)
@@ -43,7 +43,7 @@ SYNTAX: PAIR-GENERIC: (PAIR-GENERIC:) ;
 
 : define-pair-method ( a b pair-generic definition -- )
     [ 2array ] 2dip swap
-    [ "pair-generic-methods" word-prop [ swap ] dip set-at ] 
+    [ "pair-generic-methods" word-prop swapd set-at ]
     [ make-pair-generic ] bi ;
 
 : ?prefix-swap ( quot ? -- quot' )
index ba697df8d1039f4ad489f571ad4a7c00f5820963..fd39ed09a8e64a2cda5f1c68fd342c63c93e7965 100644 (file)
@@ -10,7 +10,7 @@ TUPLE: push-insn value ;
 GENERIC: eval-insn ( stack insn -- stack )
 
 : binary-op ( stack quot: ( x y -- z ) -- stack )
-    [ uncons uncons [ swap ] dip ] dip dip cons ; inline
+    [ uncons uncons swapd ] dip dip cons ; inline
 
 M: add-insn eval-insn drop [ + ] binary-op ;
 M: sub-insn eval-insn drop [ - ] binary-op ;
index d9f23ac5b8c4c95edf63675734028f051b0902da..c3bbda65259ca047019c52161cd2a97c1ec3ef99 100644 (file)
@@ -34,7 +34,7 @@ MACRO: set-slot ( name -- quot: ( value tuple -- ) )
 ! Chainable setters
 
 : set-slot* ( tuple value name -- tuple )
-    [ swap ] dip '[ _ set-slot ] keep ; inline
+    swapd '[ _ set-slot ] keep ; inline
 
 : change-slot* ( tuple name quot: ( ..a old -- ..b new ) -- ..b tuple ) 
     '[ _ _ change-slot ] keep ; inline
@@ -43,6 +43,7 @@ MACRO: set-slot ( name -- quot: ( value tuple -- ) )
 
 MACRO: slots ( names -- quot: ( tuple -- values... ) )
     [ '[ _ slot ] ] { } map-as '[ _ cleave ] ;
+
 MACRO: {slots} ( names -- quot: ( tuple -- {values} ) )
     dup length '[ _ slots _ narray ] ;