functional programming - Mutate vector in scheme by appending vectors -
i don't know underlying implementation of vectors in scheme, hence not sure how write vector-append!
prototype:
(define (vector-append! vect . vects) ; definition here )
p.s. preferred use vector on list since vector-ref
constant time operation [src]
you can't resize vector after creation, vector-append!
can not implemented in-place operation. can do, create new vector size equal sum of subvectors' sizes, elements in subvectors copied 1 after other.
use vector-grow
starting procedure, , work there. you'll have play bit indexes working solution.
Comments
Post a Comment