]> gitweb.factorcode.org Git - factor.git/commitdiff
endian: fix hints.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 30 Dec 2021 06:51:30 +0000 (22:51 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 30 Dec 2021 06:51:30 +0000 (22:51 -0800)
basis/endian/endian.factor

index 90c6e281471424c1cc14c5797ac7e4753596f0d6..8d70e319d74e65611183dc4c11aec0ac1d24fe72 100644 (file)
@@ -1,13 +1,8 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-
 USING: alien.c-types alien.data byte-arrays combinators
-combinators.smart endian kernel math math.ranges sequences
-sequences.generalizations ;
-
-USING: alien.c-types alien.data grouping kernel
-math.bitwise namespaces sequences ;
-
+combinators.smart grouping hints kernel math math.bitwise
+math.ranges namespaces sequences sequences.generalizations ;
 IN: endian
 
 SINGLETONS: big-endian little-endian ;
@@ -48,18 +43,6 @@ MACRO: reassemble-le ( n -- quot ) le-range reassemble-bytes ;
 :: n-le> ( bytes n -- x )
     bytes n check-length drop n firstn-unsafe n reassemble-le ; inline
 
-! HINTS: n-be> { byte-array object } ;
-! HINTS: n-le> { byte-array object } ;
-
-! { >le >be } [
-!     { { fixnum fixnum } { bignum fixnum } }
-!     set-specializer
-! ] each
-
-! { le> be> } [
-!     { byte-array } set-specializer
-! ] each
-
 : if-endian ( endian bytes-quot seq-quot -- )
     [
         compute-native-endianness =
@@ -235,3 +218,14 @@ M: little-endian signed-endian> signed-le> ;
         ] if concat
     ] if ; inline
 
+HINTS: n-be> { byte-array object } ;
+HINTS: n-le> { byte-array object } ;
+
+{ >le >be } [
+    { { fixnum fixnum } { bignum fixnum } }
+    set-specializer
+] each
+
+{ le> be> } [
+    { byte-array } set-specializer
+] each