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 + ) + ) +)