4f849ebd34
The type inference for collections (tuples, vectors, matrices, and records) has been significantly refactored. This includes: - Introducing distinct `StaticType` variants for `Tuple`, `Vector`, and `Matrix`. - Implementing more robust type checking for these collections, allowing for homogeneous and heterogeneous structures. - Enhancing the `is_assignable_from` method to handle type compatibility between these collection types. - Updating `Value::static_type()` to correctly infer the types of literal collections. - Improving the type inference for map literals to create `Record` types. - Adding comprehensive unit tests for tuple, vector, matrix, and record type inference.
20 lines
327 B
Plaintext
20 lines
327 B
Plaintext
;; Complex Data Structure Test
|
|
;; Benchmark: 51.4us
|
|
;; Output: {:input 10, :name "Fibonacci", :output 55}
|
|
(do
|
|
(def fib (fn [n]
|
|
(if (< n 2)
|
|
n
|
|
(+ (fib (- n 1)) (fib (- n 2))))))
|
|
|
|
(def result (fib 10))
|
|
|
|
(def data {
|
|
:name "Fibonacci"
|
|
:input 10
|
|
:output result
|
|
})
|
|
|
|
data
|
|
)
|