Clarify documentation for resize-array, resize-byte-array, resize-string words, and remove flushable declaration since technically they don't satisfy the flushable contract (reported by Daniel Ehrenberg)
parent
6b0b4bbd70
commit
5ae75af6a8
|
@ -431,9 +431,9 @@ M: bad-executable summary
|
||||||
\ quot-compiled? { quotation } { object } define-primitive
|
\ quot-compiled? { quotation } { object } define-primitive
|
||||||
\ quotation-code { quotation } { integer integer } define-primitive \ quotation-code make-flushable
|
\ quotation-code { quotation } { integer integer } define-primitive \ quotation-code make-flushable
|
||||||
\ reset-dispatch-stats { } { } define-primitive
|
\ reset-dispatch-stats { } { } define-primitive
|
||||||
\ resize-array { integer array } { array } define-primitive \ resize-array make-flushable
|
\ resize-array { integer array } { array } define-primitive
|
||||||
\ resize-byte-array { integer byte-array } { byte-array } define-primitive \ resize-byte-array make-flushable
|
\ resize-byte-array { integer byte-array } { byte-array } define-primitive
|
||||||
\ resize-string { integer string } { string } define-primitive \ resize-string make-flushable
|
\ resize-string { integer string } { string } define-primitive
|
||||||
\ retainstack { } { array } define-primitive \ retainstack make-flushable
|
\ retainstack { } { array } define-primitive \ retainstack make-flushable
|
||||||
\ retainstack-for { c-ptr } { array } define-primitive \ retainstack-for make-flushable
|
\ retainstack-for { c-ptr } { array } define-primitive \ retainstack-for make-flushable
|
||||||
\ set-alien-cell { c-ptr c-ptr integer } { } define-primitive
|
\ set-alien-cell { c-ptr c-ptr integer } { } define-primitive
|
||||||
|
|
|
@ -33,6 +33,8 @@ $nl
|
||||||
3array
|
3array
|
||||||
4array
|
4array
|
||||||
}
|
}
|
||||||
|
"Resizing arrays:"
|
||||||
|
{ $subsections resize-array }
|
||||||
"The class of two-element arrays:"
|
"The class of two-element arrays:"
|
||||||
{ $subsections pair }
|
{ $subsections pair }
|
||||||
"Arrays can be accessed without bounds checks in a pointer unsafe way."
|
"Arrays can be accessed without bounds checks in a pointer unsafe way."
|
||||||
|
@ -69,9 +71,10 @@ HELP: 4array
|
||||||
{ $values { "w" object } { "x" object } { "y" object } { "z" object } { "array" array } }
|
{ $values { "w" object } { "x" object } { "y" object } { "z" object } { "array" array } }
|
||||||
{ $description "Create a new array with four elements, with " { $snippet "w" } " appearing first." } ;
|
{ $description "Create a new array with four elements, with " { $snippet "w" } " appearing first." } ;
|
||||||
|
|
||||||
HELP: resize-array ( n array -- newarray )
|
HELP: resize-array ( n array -- new-array )
|
||||||
{ $values { "n" "a non-negative integer" } { "array" array } { "newarray" "a new array" } }
|
{ $values { "n" "a non-negative integer" } { "array" array } { "new-array" array } }
|
||||||
{ $description "Creates a new array of " { $snippet "n" } " elements. The contents of the existing array are copied into the new array; if the new array is shorter, only an initial segment is copied, and if the new array is longer the remaining space is filled in with "{ $link f } "." } ;
|
{ $description "Resizes the array to have a length of " { $snippet "n" } " elements. When making the array shorter, this word may either create a new array or modify the existing array in place. When making the array longer, this word always allocates a new array, filling remaining space with " { $link f } "." }
|
||||||
|
{ $side-effects "array" } ;
|
||||||
|
|
||||||
HELP: pair
|
HELP: pair
|
||||||
{ $class-description "The class of two-element arrays, known as pairs." } ;
|
{ $class-description "The class of two-element arrays, known as pairs." } ;
|
||||||
|
|
|
@ -424,10 +424,10 @@ tuple
|
||||||
{ "dll-valid?" "alien.libraries" "primitive_dll_validp" (( dll -- ? )) }
|
{ "dll-valid?" "alien.libraries" "primitive_dll_validp" (( dll -- ? )) }
|
||||||
{ "current-callback" "alien.private" "primitive_current_callback" (( -- n )) }
|
{ "current-callback" "alien.private" "primitive_current_callback" (( -- n )) }
|
||||||
{ "<array>" "arrays" "primitive_array" (( n elt -- array )) }
|
{ "<array>" "arrays" "primitive_array" (( n elt -- array )) }
|
||||||
{ "resize-array" "arrays" "primitive_resize_array" (( n array -- newarray )) }
|
{ "resize-array" "arrays" "primitive_resize_array" (( n array -- new-array )) }
|
||||||
{ "(byte-array)" "byte-arrays" "primitive_uninitialized_byte_array" (( n -- byte-array )) }
|
{ "(byte-array)" "byte-arrays" "primitive_uninitialized_byte_array" (( n -- byte-array )) }
|
||||||
{ "<byte-array>" "byte-arrays" "primitive_byte_array" (( n -- byte-array )) }
|
{ "<byte-array>" "byte-arrays" "primitive_byte_array" (( n -- byte-array )) }
|
||||||
{ "resize-byte-array" "byte-arrays" "primitive_resize_byte_array" (( n byte-array -- newbyte-array )) }
|
{ "resize-byte-array" "byte-arrays" "primitive_resize_byte_array" (( n byte-array -- new-byte-array )) }
|
||||||
{ "<tuple-boa>" "classes.tuple.private" "primitive_tuple_boa" (( slots... layout -- tuple )) }
|
{ "<tuple-boa>" "classes.tuple.private" "primitive_tuple_boa" (( slots... layout -- tuple )) }
|
||||||
{ "<tuple>" "classes.tuple.private" "primitive_tuple" (( layout -- tuple )) }
|
{ "<tuple>" "classes.tuple.private" "primitive_tuple" (( layout -- tuple )) }
|
||||||
{ "modify-code-heap" "compiler.units" "primitive_modify_code_heap" (( alist update-existing? reset-pics? -- )) }
|
{ "modify-code-heap" "compiler.units" "primitive_modify_code_heap" (( alist update-existing? reset-pics? -- )) }
|
||||||
|
|
|
@ -22,7 +22,7 @@ $nl
|
||||||
3byte-array
|
3byte-array
|
||||||
4byte-array
|
4byte-array
|
||||||
}
|
}
|
||||||
"Resizing byte-arrays:"
|
"Resizing byte arrays:"
|
||||||
{ $subsections resize-byte-array } ;
|
{ $subsections resize-byte-array } ;
|
||||||
|
|
||||||
ABOUT: "byte-arrays"
|
ABOUT: "byte-arrays"
|
||||||
|
@ -70,7 +70,7 @@ HELP: 4byte-array
|
||||||
|
|
||||||
{ 1byte-array 2byte-array 3byte-array 4byte-array } related-words
|
{ 1byte-array 2byte-array 3byte-array 4byte-array } related-words
|
||||||
|
|
||||||
HELP: resize-byte-array ( n byte-array -- newbyte-array )
|
HELP: resize-byte-array ( n byte-array -- new-byte-array )
|
||||||
{ $values { "n" "a non-negative integer" } { "byte-array" byte-array }
|
{ $values { "n" "a non-negative integer" } { "byte-array" byte-array } { "new-byte-array" byte-array } }
|
||||||
{ "newbyte-array" byte-array } }
|
{ $description "Resizes the byte array to have a length of " { $snippet "n" } " elements. When making the byte array shorter, this word may either create a new byte array or modify the existing byte array in place. When making the byte array longer, this word always allocates a new byte array, filling remaining space with zeroes." }
|
||||||
{ $description "Creates a new byte-array of n elements. The contents of the existing byte-array are copied into the new byte-array; if the new byte-array is shorter, only an initial segment is copied, and if the new byte-array is longer the remaining space is filled in with 0." } ;
|
{ $side-effects "byte-array" } ;
|
||||||
|
|
|
@ -20,6 +20,8 @@ $nl
|
||||||
}
|
}
|
||||||
"Creating a string from a single character:"
|
"Creating a string from a single character:"
|
||||||
{ $subsections 1string }
|
{ $subsections 1string }
|
||||||
|
"Resizing strings:"
|
||||||
|
{ $subsections resize-string }
|
||||||
{ $see-also "syntax-strings" "sbufs" "unicode" "io.encodings" } ;
|
{ $see-also "syntax-strings" "sbufs" "unicode" "io.encodings" } ;
|
||||||
|
|
||||||
ABOUT: "strings"
|
ABOUT: "strings"
|
||||||
|
@ -53,4 +55,5 @@ HELP: >string
|
||||||
|
|
||||||
HELP: resize-string ( n str -- newstr )
|
HELP: resize-string ( n str -- newstr )
|
||||||
{ $values { "n" "a non-negative integer" } { "str" string } { "newstr" string } }
|
{ $values { "n" "a non-negative integer" } { "str" string } { "newstr" string } }
|
||||||
{ $description "Creates a new string " { $snippet "n" } " characters long The contents of the existing string are copied into the new string; if the new string is shorter, only an initial segment is copied, and if the new string is longer the remaining space is filled with " { $snippet "\\u000000" } "." } ;
|
{ $description "Resizes the string to have a length of " { $snippet "n" } " elements. When making the string shorter, this word may either create a new string or modify the existing string in place. When making the string longer, this word always allocates a new string, filling remaining space with zeroes." }
|
||||||
|
{ $side-effects "str" } ;
|
||||||
|
|
Loading…
Reference in New Issue