Files
RustAst/examples/macro_financial.myc
T
2026-02-22 00:43:39 +01:00

10 lines
283 B
Plaintext

;; Benchmark: 384ns
;; Benchmark-Repeat: 5255
;; Financial DSL Macro example
;; Demonstrates generating complex records from simple parameters.
;; Output: {:price 100, :size 2, :total 200}
(do
(macro trade [p s] `{:price ~p :size ~s :total (* ~p ~s)})
(trade 100 2))