87259584ee
The `Value::List` and `Value::Record` variants have been consolidated into a single `Value::Tuple` variant. This new variant uses a `TupleData` struct to store values and an optional `Rc<Vec<Keyword>>` for keys, allowing it to represent both ordered lists/tuples and key-value records. This change simplifies the internal representation and improves performance by allowing schema sharing for records. It also includes updates to the compiler, runtime, and tests to reflect the new structure.
12 lines
205 B
Plaintext
12 lines
205 B
Plaintext
;; Record to Tuple Mapping Test
|
|
;; Output: 30
|
|
;; Benchmark: 700ns
|
|
(do
|
|
(def rec {:x 10 :y 20})
|
|
|
|
;; Map record to tuple pattern
|
|
(def add-tuple (fn [[a b]] (+ a b)))
|
|
|
|
(add-tuple rec)
|
|
)
|