chickadee » srfi-1 » split-at!

split-at x iprocedure
split-at! x iprocedure

split-at splits the list X at index I, returning a list of the first I elements, and the remaining tail. It is equivalent to

(values (take x i) (drop x i))

split-at! is the linear-update variant. It is allowed, but not required, to alter the argument list to produce the result.

(split-at '(a b c d e f g h) 3) =>
    (a b c)
    (d e f g h)