Files
RustAst/examples/record_specialization_test.myc
T
Brummel 10a7fcb576 Refactor: Replace Object with StreamStorage for streams
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`.
2026-03-29 18:01:46 +02:00

24 lines
593 B
Plaintext

;; Benchmark: 1.1us
;; Benchmark-Repeat: 1783
;; Test Record SoA specialization in Pipelines
;; Dank der neuen Spezialisierung wird hierfür im Hintergrund
;; eine SharedRecordSeries mit SoA-Layout (Float-Puffer für mid und range) erstellt.
(do
(def ohlc_stream (create-random-ohlc 42 10))
;; Pipe die einen Record erzeugt
(def indicator
(pipe [ohlc_stream]
(fn [ohlc]
{
:mid (/ (+ (.high ohlc) (.low ohlc)) 2.0)
:range (- (.high ohlc) (.low ohlc))
}
)
)
)
(assert-eq :stream (type-of indicator))
)