]> gitweb.factorcode.org Git - factor.git/blobdiff - core/io/binary/binary-docs.factor
use radix literals
[factor.git] / core / io / binary / binary-docs.factor
index ab82abe146e289f585ab745747b0b6acc3fcd901..250f4e2880220be130ec8a365332f434b8484edd 100644 (file)
@@ -6,7 +6,7 @@ ARTICLE: "stream-binary" "Working with binary data"
 $nl
 "There are two ways to order the bytes making up an integer; " { $emphasis "little endian" } " byte order outputs the least significant byte first, and the most significant byte last, whereas " { $emphasis "big endian" } " is the other way around."
 $nl
-"Consider the hexadecimal integer "{ $snippet "HEX: cafebabe" } ". Little endian byte order yields the following sequence of bytes:"
+"Consider the hexadecimal integer " { $snippet "0xcafebabe" } ". Little endian byte order yields the following sequence of bytes:"
 { $table
     { "Byte:" "1" "2" "3" "4" }
     { "Value:" { $snippet "be" } { $snippet "ba" } { $snippet "fe" } { $snippet "ca" } }
@@ -17,15 +17,21 @@ $nl
     { "Value:" { $snippet "ca" } { $snippet "fe" } { $snippet "ba" } { $snippet "be" } }
 }
 "Two words convert a sequence of bytes into an integer:"
-{ $subsection be> }
-{ $subsection le> }
+{ $subsections
+    be>
+    le>
+}
 "Two words convert an integer into a sequence of bytes:"
-{ $subsection >be }
-{ $subsection >le }
+{ $subsections
+    >be
+    >le
+}
 "Words for taking larger integers apart into smaller integers:"
-{ $subsection d>w/w }
-{ $subsection w>h/h }
-{ $subsection h>b/b } ;
+{ $subsections
+    d>w/w
+    w>h/h
+    h>b/b
+} ;
 
 ABOUT: "stream-binary"