d08fab4f73
This commit extracts the logic for inlining function calls into a new private method, `try_inline`. This improves code organization and reduces duplication in the `Optimizer`'s `visit_node` method. The extracted method handles the preparation of substitutions and the recursive visiting of the inlined node. It also ensures that the substitution map state is correctly synchronized back to the calling context.
13 lines
306 B
Plaintext
13 lines
306 B
Plaintext
#use rtl
|
|
|
|
(do
|
|
(def src (create-random-ohlc 42 200))
|
|
|
|
(macro printx [s] `(fn [x] (print ~s x)))
|
|
|
|
(pipe src print)
|
|
(pipe [(pipe [(.close src)] (SMA 20))] (printx "sma20="))
|
|
(pipe [(pipe [(.close src)] (SMA 5))] (printx "sma5="))
|
|
(pipe [(pipe [(.close src)] (SMA 100))] (printx "sma100="))
|
|
)
|