Add prelude and while macro
This commit introduces a new prelude file that defines the `while` macro and registers it during environment bootstrapping. The `again` macro has been updated to accept multiple arguments for its recursive call, and several examples have been adjusted to reflect this change. Additionally, the `MacroRegistry` in the compiler is now cloneable and can be moved out of the `MacroExpander`.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
;; Myc Prelude
|
||||
;; This file is evaluated during Environment bootstrapping.
|
||||
;; It contains standard macros and functions.
|
||||
|
||||
(macro while [cond body]
|
||||
`((fn [] (if ~cond
|
||||
(do ~body (again))
|
||||
)))
|
||||
)
|
||||
Reference in New Issue
Block a user