From 60299f6d749e0dc1f156c471aef7c2a9f34aff28 Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@slava-pestovs-macbook-pro.local>
Date: Mon, 3 May 2010 18:31:01 -0400
Subject: [PATCH] Eliminate some -rot from the codebase

---
 basis/game/input/xinput/xinput.factor         |  2 +-
 .../windows/nt/privileges/privileges.factor   | 22 ++++++++++++-------
 basis/math/blas/matrices/matrices.factor      | 12 +++++-----
 3 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/basis/game/input/xinput/xinput.factor b/basis/game/input/xinput/xinput.factor
index 568deb3750..32c2cd47bf 100644
--- a/basis/game/input/xinput/xinput.factor
+++ b/basis/game/input/xinput/xinput.factor
@@ -30,7 +30,7 @@ MACRO: map-index-compose ( seq quot -- seq )
       XINPUT_GAMEPAD_B
       XINPUT_GAMEPAD_X
       XINPUT_GAMEPAD_Y }
-      [ [ bitand ] dip swap 0 = [ 2drop ] [ 1.0 -rot swap set-nth ] if ]
+      [ [ bitand ] dip swap 0 = [ 2drop ] [ [ 1.0 ] 2dip swap set-nth ] if ]
       map-index-compose 2cleave ;
 
  : >pov ( byte -- symbol )
diff --git a/basis/io/backend/windows/nt/privileges/privileges.factor b/basis/io/backend/windows/nt/privileges/privileges.factor
index 53a67bbeab..6c63d3eda0 100644
--- a/basis/io/backend/windows/nt/privileges/privileges.factor
+++ b/basis/io/backend/windows/nt/privileges/privileges.factor
@@ -1,8 +1,10 @@
-USING: alien alien.c-types alien.data alien.syntax arrays continuations
-destructors generic io.mmap io.ports io.backend.windows io.files.windows
-kernel libc locals math math.bitwise namespaces quotations sequences windows
-windows.advapi32 windows.kernel32 windows.types io.backend system accessors
-io.backend.windows.privileges classes.struct windows.errors literals ;
+USING: alien alien.c-types alien.data alien.syntax arrays
+continuations destructors generic io.mmap io.ports
+io.backend.windows io.files.windows kernel libc fry locals math
+math.bitwise namespaces quotations sequences windows
+windows.advapi32 windows.kernel32 windows.types io.backend
+system accessors io.backend.windows.privileges classes.struct
+windows.errors literals ;
 IN: io.backend.windows.nt.privileges
 
 TYPEDEF: TOKEN_PRIVILEGES* PTOKEN_PRIVILEGES
@@ -37,7 +39,11 @@ TYPEDEF: TOKEN_PRIVILEGES* PTOKEN_PRIVILEGES
         >>Privileges ;
 
 M: winnt set-privilege ( name ? -- )
-    [
-        -rot 0 -rot make-token-privileges
-        dup byte-length f f AdjustTokenPrivileges win32-error=0/f
+    '[
+        0
+        _ _ make-token-privileges
+        dup byte-length
+        f
+        f
+        AdjustTokenPrivileges win32-error=0/f
     ] with-process-token ;
diff --git a/basis/math/blas/matrices/matrices.factor b/basis/math/blas/matrices/matrices.factor
index 22c649c544..a551190dbd 100644
--- a/basis/math/blas/matrices/matrices.factor
+++ b/basis/math/blas/matrices/matrices.factor
@@ -137,7 +137,7 @@ M: blas-matrix-base clone
 : <empty-matrix> ( rows cols exemplar -- matrix )
     [ element-type heap-size * * <byte-array> ]
     [ 2drop ]
-    [ f swap (blas-matrix-like) ] 3tri ;
+    [ [ f ] dip (blas-matrix-like) ] 3tri ;
 
 : n*M.V+n*V ( alpha A x beta y -- alpha*A.x+b*y )
     clone n*M.V+n*V! ;
@@ -153,7 +153,7 @@ M: blas-matrix-base clone
     n*M.V+n*V! ; inline
 
 : M.V ( A x -- A.x )
-    1.0 -rot n*M.V ; inline
+    [ 1.0 ] 2dip n*M.V ; inline
 
 : n*V(*)V ( alpha x y -- alpha*x(*)y )
     2dup [ length>> ] bi@ pick <empty-matrix>
@@ -163,16 +163,16 @@ M: blas-matrix-base clone
     n*V(*)Vconj+M! ;
 
 : V(*) ( x y -- x(*)y )
-    1.0 -rot n*V(*)V ; inline
+    [ 1.0 ] 2dip n*V(*)V ; inline
 : V(*)conj ( x y -- x(*)yconj )
-    1.0 -rot n*V(*)Vconj ; inline
+    [ 1.0 ] 2dip n*V(*)Vconj ; inline
 
 : n*M.M ( alpha A B -- alpha*A.B )
     2dup [ Mheight ] [ Mwidth ] bi* pick <empty-matrix> 
-    1.0 swap n*M.M+n*M! ;
+    [ 1.0 ] dip n*M.M+n*M! ;
 
 : M. ( A B -- A.B )
-    1.0 -rot n*M.M ; inline
+    [ 1.0 ] 2dip n*M.M ; inline
 
 :: (Msub) ( matrix row col height width -- data ld rows cols )
     matrix ld>> col * row + matrix element-type heap-size *