94fc6bf56d
This commit introduces support for AST macros and templates, enabling users to define and use custom, reusable components within the visual DSL. Key changes include: - A new `MacroRegistry` to manage macro definitions. - A `MacroExpander` to process macro calls and expand templates. - A `MacroEvaluator` trait for evaluating expressions during expansion. - The `Expansion` node in `BoundKind` to preserve the original macro call and its expanded form for debugging. - Updates to the `Binder`, `Dumper`, and `UpvalueAnalyzer` to handle the new macro constructs. - New examples demonstrating various macro functionalities like `unless`, splicing, and nested macros.
20 lines
327 B
Plaintext
20 lines
327 B
Plaintext
;; Complex Data Structure Test
|
|
;; Benchmark: 49.8us
|
|
;; 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
|
|
)
|