Files
RustAst/examples/record_to_tuple.myc
T
Michael Schimmel ca2c85a8a4 Refactor map and record representation
Replaces the use of `BTreeMap` and `HashMap` for maps and records with
`Vec<(Keyword, Value)>` and `Vec<(Keyword, StaticType)>`. This
simplifies the data structure and allows for ordered iteration, which is
important for serialization and comparison.

Also updates the `unpack` function in `vm.rs` to handle records as well
as lists when destructuring.
2026-02-20 15:10:07 +01:00

11 lines
184 B
Plaintext

;; Record to Tuple Mapping Test
;; Output: 30
(do
(def rec {:x 10 :y 20})
;; Map record to tuple pattern
(def add-tuple (fn [[a b]] (+ a b)))
(add-tuple rec)
)