]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/base16/base16.factor
base16/32/64/85/91: declare base>ch as fixnum.
[factor.git] / extra / base16 / base16.factor
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 [