]> gitweb.factorcode.org Git - factor.git/commitdiff
base16/32/64/85/91: declare base>ch as fixnum.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 19 May 2019 23:23:35 +0000 (16:23 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 19 May 2019 23:23:35 +0000 (16:23 -0700)
basis/base64/base64.factor
extra/base16/base16.factor
extra/base32/base32.factor
extra/base85/base85.factor
extra/base91/base91.factor

index aff50fb2309b946bab75ab1b4cdbbff2c62831c2..98f549b4a2ea0f1425473149ab9ea56850543faa 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008 Doug Coleman, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays assocs byte-arrays combinators fry io io.binary
-io.encodings.binary io.streams.byte-array kernel literals math
-namespaces sbufs sequences ;
+io.encodings.binary io.streams.byte-array kernel kernel.private
+literals math namespaces sbufs sequences ;
 IN: base64
 
 ERROR: malformed-base64 ;
@@ -26,7 +26,7 @@ CONSTANT: alphabet $[
 
 : base64>ch ( ch -- ch )
     $[ alphabet alphabet-inverse 0 CHAR: = pick set-nth ] nth
-    [ malformed-base64 ] unless* ; inline
+    [ malformed-base64 ] unless* { fixnum } declare ; inline
 
 : (write-lines) ( column byte-array -- column' )
     output-stream get dup '[
index 28890595032cbcd63dddf6abe1dec0d2520d6ebb..4db071d6b7b365c4b471033a101e8c438746ea8f 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2019 John Benediktsson.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: base64.private byte-arrays combinators io
-io.encodings.binary io.streams.byte-array kernel literals locals
-math namespaces sequences ;
+io.encodings.binary io.streams.byte-array kernel kernel.private
+literals locals math namespaces sequences ;
 IN: base16
 
 ERROR: malformed-base16 ;
@@ -20,7 +20,7 @@ CONSTANT: alphabet $[ "0123456789ABCDEF" >byte-array ]
 
 : base16>ch ( ch -- ch )
     $[ alphabet alphabet-inverse ] nth
-    [ malformed-base16 ] unless* ; inline
+    [ malformed-base16 ] unless* { fixnum } declare ; inline
 
 :: (encode-base16) ( stream -- )
     stream stream-read1 [
index b0681488de31196765e17bbc53097f6a843dea65..90c362f48f4831428ac9cb67e4f0f82d398d69c4 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2019 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 USING: base64.private byte-arrays combinators fry io io.binary
-io.encodings.binary io.streams.byte-array kernel literals math
-namespaces sequences ;
+io.encodings.binary io.streams.byte-array kernel kernel.private
+literals math namespaces sequences ;
 IN: base32
 
 ERROR: malformed-base32 ;
@@ -22,7 +22,7 @@ CONSTANT: alphabet $[ "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" >byte-array ]
 
 : base32>ch ( ch -- ch )
     $[ alphabet alphabet-inverse 0 CHAR: = pick set-nth ] nth
-    [ malformed-base32 ] unless* ; inline
+    [ malformed-base32 ] unless* { fixnum } declare ; inline
 
 : encode5 ( seq -- byte-array )
     be> { -35 -30 -25 -20 -15 -10 -5 0 } '[
index 5e21d73222f0415c8e321ef38b17fa2456742d88..bbf98e13c2018ecc5579bda6d9b75ac74008db1f 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2013 John Benediktsson.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: base64.private byte-arrays combinators io io.binary
-io.encodings.binary io.streams.byte-array kernel literals math
-namespaces sequences ;
+io.encodings.binary io.streams.byte-array kernel kernel.private
+literals math namespaces sequences ;
 IN: base85
 
 ERROR: malformed-base85 ;
@@ -21,7 +21,7 @@ CONSTANT: alphabet $[
 
 : base85>ch ( ch -- ch )
     $[ alphabet alphabet-inverse ] nth
-    [ malformed-base85 ] unless* ; inline
+    [ malformed-base85 ] unless* { fixnum } declare ; inline
 
 : encode4 ( seq -- seq' )
     be> 5 [ 85 /mod ch>base85 ] B{ } replicate-as reverse! nip ; inline
index 05a07842fe12e410372bc42f155221cfdbc5e682..fba9b49f6532a971c8f24882c0fcb63d6c8b185b 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2019 John Benediktsson.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: base64.private byte-arrays kernel literals locals math
-sequences ;
+USING: base64.private byte-arrays kernel kernel.private
+literals locals math sequences ;
 IN: base91
 
 ERROR: malformed-base91 ;
@@ -20,7 +20,7 @@ CONSTANT: alphabet $[
 
 : base91>ch ( ch -- ch )
     $[ alphabet alphabet-inverse ] nth
-    [ malformed-base91 ] unless* ; inline
+    [ malformed-base91 ] unless* { fixnum } declare ; inline
 
 PRIVATE>