]> gitweb.factorcode.org Git - factor.git/commitdiff
byte-arrays: make docs more clear.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 21 Jun 2022 18:23:51 +0000 (11:23 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 21 Jun 2022 18:23:51 +0000 (11:23 -0700)
core/byte-arrays/byte-arrays-docs.factor

index 581699ce889c73bc62b66e5fd8ca82f033ff267c..6a62122eb1e07807c0ed5cab3cdecfc15f299d8a 100644 (file)
@@ -31,12 +31,16 @@ HELP: byte-array
 { $class-description "The class of byte arrays. See " { $link "syntax-byte-arrays" } " for syntax and " { $link "byte-arrays" } " for general information." } ;
 
 HELP: <byte-array>
-{ $values { "n" "a non-negative integer" } { "byte-array" "a new byte array" } }
-{ $description "Creates a new byte array holding " { $snippet "n" } " bytes." } ;
+{ $values { "n" "a non-negative integer" } { "byte-array" byte-array } }
+{ $examples { $example "USING: byte-arrays prettyprint ;" "3 <byte-array> ." "B{ 0 0 0 }" } }
+{ $description "Creates a new " { $link byte-array } " of length " { $snippet "n" } " bytes, with the elements all initialized to zero." } ;
 
 HELP: (byte-array)
-{ $values { "n" "a non-negative integer" } { "byte-array" "a new byte array" } }
-{ $description "Creates a new byte array with unspecified contents of length " { $snippet "n" } " bytes." } ;
+{ $values { "n" "a non-negative integer" } { "byte-array" byte-array } }
+{ $examples { $unchecked-example "USING: byte-arrays prettyprint ;" "3 (byte-array) ." "B{ 103 189 48 }" } }
+{ $description "Creates a new " { $link byte-array } " of length " { $snippet "n" } " bytes, with the elements containing unspecified values." } ;
+
+{ <byte-array> (byte-array) } related-words
 
 HELP: >byte-array
 { $values { "seq" sequence } { "byte-array" byte-array } }