10a7fcb576
The `Object` trait is too generic and has been causing confusion. This commit introduces `StreamStorage` as a dedicated trait for reactive stream types. This change involves: - Renaming `Object` to `StreamStorage` in relevant places. - Updating the `Value::Object` enum variant to `Value::Stream`. - Modifying how streams are handled in the compiler, VM, and tests to use the new `StreamStorage` trait. - Adjusting example scripts and tests to reflect the change in type representation. - The `StreamNode` struct now explicitly holds its `element_type`.
24 lines
360 B
Plaintext
24 lines
360 B
Plaintext
;; Benchmark: 1.8us
|
|
;; Benchmark-Repeat: 1150
|
|
|
|
(do
|
|
(def src1 (create-random-ohlc 42 3))
|
|
|
|
(def combined
|
|
(pipe [src1]
|
|
(fn [t1]
|
|
(.close t1)
|
|
)
|
|
)
|
|
)
|
|
|
|
(def my_indicator
|
|
(pipe [combined]
|
|
(fn [close_price]
|
|
(+ close_price 10.0)
|
|
)
|
|
)
|
|
)
|
|
|
|
(assert-eq :stream (type-of my_indicator))
|
|
) |