Refactor series implementation into its own module

This commit reorganizes the series-related code by moving the
`RingBuffer`, `ScalarSeries`, `ValueSeries`, `RecordSeries`,
`SeriesView`, and `SharedSeries` structs into a new
`src/ast/rtl/series/data.rs` file.

The `src/ast/rtl/series/mod.rs` file now contains the module
declaration, re-exports, and the `register` function for registering
series-related native functions with the environment. This improves code
organization and maintainability.
This commit is contained in:
2026-03-22 21:22:56 +01:00
parent 09ae98728f
commit 99b540c84e
4 changed files with 684 additions and 676 deletions
+30
View File
@@ -0,0 +1,30 @@
;; Myc System Library
;; Standard macros and core utilities.
(do
(macro while [cond body]
`((fn [] (if ~cond
(do ~body (again))
)))
)
(macro repeat [var limit body]
`((fn [~var __limit]
(if (< ~var __limit)
(do
~body
(again (+ ~var 1) __limit)
)
))
0 ~limit)
)
;; Creates a stateful cache (Series) from a stateless stream.
(macro cache [lookback type src]
`(do
(def data (series ~lookback ~type))
(pipe [~src] (fn [s] (do (push data s))))
data
)
)
)