]> gitweb.factorcode.org Git - factor.git/commitdiff
move >signed to math.bitwise
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 14 Feb 2009 06:31:17 +0000 (00:31 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 14 Feb 2009 06:31:17 +0000 (00:31 -0600)
basis/endian/endian.factor
basis/math/bitwise/bitwise.factor

index a453a7170423469fa914a9663b43b6c95316d856..492845854315c969fbc2337d7d3664e960471a76 100755 (executable)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types namespaces io.binary fry
-kernel math grouping sequences ;
+kernel math grouping sequences math.bitwise ;
 IN: endian
 
 SINGLETONS: big-endian little-endian ;
@@ -9,9 +9,6 @@ SINGLETONS: big-endian little-endian ;
 : compute-native-endianness ( -- class )
     1 <int> *char 0 = big-endian little-endian ? ;
 
-: >signed ( x n -- y )
-    2dup neg 1+ shift 1 = [ 2^ - ] [ drop ] if ;
-
 SYMBOL: native-endianness
 native-endianness [ compute-native-endianness ] initialize
 
index e60815bf609a17c9649e31162fbb58a83d2ff4ec..339703c0a6f3299fa0d8445851e5cf100818ef5c 100755 (executable)
@@ -102,3 +102,7 @@ PRIVATE>
 
 : signed-be> ( bytes -- x )
     <reversed> signed-le> ;
+
+: >signed ( x n -- y )
+    2dup neg 1+ shift 1 = [ 2^ - ] [ drop ] if ;
+