slovo/docs/language/examples/speculative/array-index.slo
2026-05-22 08:38:43 +02:00

18 lines
601 B
Plaintext

; status: design/speculative
; Non-contract array/index sketch retained after the v1 array value-flow
; promotion. Fixed i32 array parameters, returns, calls returning arrays, and
; dynamic indexing are promoted in examples/supported/array-value-flow.slo.
; Mutation, slices, non-i32 element types, nested arrays, equality, printing,
; unchecked indexing, and ABI/layout promises remain follow-up work.
(module array_index)
(fn pick_dynamic ((i i32)) -> i32
(index (array i32 10 20 30) i))
(fn first_arg ((values (array i32 3))) -> i32
(index values 0))
(fn main () -> i32
(pick_dynamic 1))