From b638a35fd719447ffceb9b020ec34d182012675d Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 14 Feb 2009 00:31:17 -0600 Subject: [PATCH] move >signed to math.bitwise --- basis/endian/endian.factor | 5 +---- basis/math/bitwise/bitwise.factor | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/basis/endian/endian.factor b/basis/endian/endian.factor index a453a71704..4928458543 100755 --- a/basis/endian/endian.factor +++ b/basis/endian/endian.factor @@ -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 *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 diff --git a/basis/math/bitwise/bitwise.factor b/basis/math/bitwise/bitwise.factor index e60815bf60..339703c0a6 100755 --- a/basis/math/bitwise/bitwise.factor +++ b/basis/math/bitwise/bitwise.factor @@ -102,3 +102,7 @@ PRIVATE> : signed-be> ( bytes -- x ) signed-le> ; + +: >signed ( x n -- y ) + 2dup neg 1+ shift 1 = [ 2^ - ] [ drop ] if ; +