See it run
LISPEX
(list (list-ref (list 10 20 30) 1) (vector-ref #(4 5) 0))Observed result
OUTPUT
(20 4)How to reason about it
- List access/search includes the c...r family,
list-ref,list-tail,member/assocvariants, copy, append, reverse, and constructors. - Vector construction, access, copy, map, and
vector-set!are available. Bytevectors are read-only in this profile. - Bad pair/list domains are E310, bad indices or ranges are E311, and wrong primitive types are E312.
Aggregate signatures
| Signature | Result / identity | Fault |
|---|---|---|
| (cons a d) | fresh pair | none |
| (car pair) / (cdr pair) | stored component | E310 non-pair |
| (list-ref proper-list k) | k-th element | E312 non-integer, E311 range, E310 list that does not end properly |
| (vector-ref vector k) / (vector-set! vector k value) | element / zero values, and the vector keeps its identity | E312 type, E311 range |
| (bytevector-u8-ref bytevector k) | exact integer 0..255 | E312 type, E311 range |
A common mistake
Pair and bytevector mutators are deferred, and quoted aggregates cannot be mutated.
Keep going
The manual says which aggregates exist and which of them can be mutated, and the index places these names among the other families.