Create system.myc
This commit is contained in:
@@ -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
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user