factor/library/collections/sbuf.facts

13 lines
660 B
Plaintext

IN: strings
USING: arrays help kernel vectors ;
HELP: <sbuf> "( n -- sbuf )"
{ $values { "n" "a positive integer specifying initial capacity" } { "sbuf" "a new string buffer" } }
{ $description "Creates a new string buffer that can hold " { $snippet "n" } " characters before resizing." }
{ $see-also <array> <quotation> <string> <vector> } ;
HELP: >sbuf "( seq -- sbuf )"
{ $values { "seq" "a sequence of non-negative integers" } { "sbuf" "a string buffer" } }
{ $description "Outputs a freshly-allocated string buffer with the same elements as a given sequence." }
{ $errors "Throws an error if the sequence contains elements other than real numbers." } ;