JanetDocsPlaygroundI'm feeling luckyGitHub sign in

buffer/push



    cfunction
    src/core/buffer.c on line 284, column 1

    (buffer/push buffer & xs)

    Push both individual bytes and byte sequences to a buffer. For each 
    x in xs, push the byte if x is an integer, otherwise push the 
    bytesequence to the buffer. Thus, this function behaves like both 
    `buffer/push-string` and `buffer/push-byte`. Returns the modified 
    buffer. Will throw an error if the buffer overflows.


1 exampleSign in to add an example
Loading...
(def buf-bytes 12)

(var new-buffer (buffer/new buf-bytes)) #--> @""

(buffer/push new-buffer "hello, world") #--> @"hello, world"
MorganPetersonPlayground