---
source: compiler-core/src/parse/tests.rs
expression: "\npub fn main() -> Nil {\n  let xs = [1, 2, 3]\n  let ys = [5, 6, 7]\n  [..xs, 4, ..ys]\n}\n"
---
----- SOURCE CODE

pub fn main() -> Nil {
  let xs = [1, 2, 3]
  let ys = [5, 6, 7]
  [..xs, 4, ..ys]
}


----- ERROR
error: Syntax error
  ┌─ /src/parse/error.gleam:5:4
  │
5 │   [..xs, 4, ..ys]
  │    ^^^^ I wasn't expecting elements after this

Lists are immutable and singly-linked, so to append items to them
all the elements of a list would need to be copied into a new list.
This would be slow, so there is no built-in syntax for it.

Hint: Prepend items to the list and then reverse it once you are done.
