chunk-append adds an element to a mutable ChunkBuffer while capacity remains. It is an internal building block for constructing chunks used in chunked sequential processing, not a general-purpose collection operation. section 10.12
Use the function with this contract:
- Call (chunk-append b x), where b is a ChunkBuffer and x can be any object. section 10.12
- Create the buffer with chunk-buffer, append values, then call chunk to obtain an IChunk for chunk-cons. section 10.12
- Appending to a full buffer raises ArrayIndexOutOfBoundsException. section 10.12
Build a chunk
(def b (chunk-buffer 10)) (chunk-append b 0) (chunk-append b 1) (chunk-append b 2) (def first-chunk (chunk b)) (chunk-cons first-chunk ()) ;; (0 1 2)
