From 6f2d9b0e47f6846547a3be671aab27610b9eb5b2 Mon Sep 17 00:00:00 2001 From: Michael Schimmel Date: Sun, 8 Mar 2026 13:10:00 +0100 Subject: [PATCH] Create system.myc --- src/ast/system.myc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/ast/system.myc diff --git a/src/ast/system.myc b/src/ast/system.myc new file mode 100644 index 0000000..c7d81a4 --- /dev/null +++ b/src/ast/system.myc @@ -0,0 +1,19 @@ +;; Myc System Library +;; Standard macros and core utilities. + +(do + (macro while [cond body] + `((fn [] (if ~cond + (do ~body (again)) + ))) + ) + + ;; 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 + ) + ) +)