Qu

extend

Builtin index · Collections & strings

result = extend(list, other)

Input: list, other · Output: result

What it is

list is a List (or Vec); other is a List or Vec.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = extend(list, other)
list List or Veclist is a List (or Vec).
other List or Vecother is a List or Vec.
result List, Vec, or number
Returns a NEW List holding list's elements followed by other's: it CONCATENATES, where append(list, other) NESTS other as one element (so append(["a"], ["b","c"]) has length 2 and extend(["a"], ["b","c"]) has length 3). A Vec argument contributes its numbers as list elements.

Examples

No documentation example calls this form yet. The Collections & strings chapter is where one belongs.

How it works

extend(list, other) -- a NEW list: list's elements followed by other's (a list or a vector). append(list, other) NESTS other as one element; this CONCATENATES (feedback item 2).

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.