An ordered owned collection whose elements share one language type.
Signature
List[T]List[T] stores Rust Vec<Value> data. The compiler retains T and the runtime checks elements at typed boundaries. An empty literal needs a contextual element type, such as let values: List[f64] = [];.
Indexing starts at zero and rejects out-of-range indices. Assignment copies a list value; .append(value) returns a new list. .get(index) returns Opt[T], while indexing returns Res[T, DataError]. Collection length and nested values remain subject to the embedding host's Limits.
Methods
Examples
Append without changing the original
append returns a new list. Change the appended value and compare both lists.
Show a QR code for your glasses, or send a link to another browser. You can keep working here.
Sharing starts a fresh run of the last compiled code. Your editor draft stays here.
Join a session
Open an invitation link, or paste a link or code from the other device.
On RayNeo, open Menu → Connect live and scan this code. In another browser, open the invitation link below.
Or enter this code:
Waiting for another device. You can keep working while it connects.
Browsers can edit code; every device can use scene controls. The device that started the session controls playback.
Connection settings
A full invitation link includes its host. With a code alone, both devices need the same live host. Pairing setup
No output.
- Executed source spans appear here.
Expected output
2 2 4 6
Rust definition
Value::List(Vec<Value>); static T and runtime validation enforce homogeneous elements.