76586c0903
Introduces a `Symbol` struct to represent identifiers, incorporating macro hygiene context. Updates various parts of the AST compiler and environment to use `Symbol` instead of raw `Rc<str>` for identifiers, improving robustness for macro expansions. Also includes: - Adds a new example `macro_hygiene.myc`. - Updates `.gitignore`. - Refactors `MacroExpander` to use `ExpansionState` for cleaner template expansion. - Adjusts `VM::eval_observed` to ensure `after_eval` is called correctly. - Resets `Environment` for each test run and compilation/dumping in `main.rs`.
8 lines
94 B
Plaintext
8 lines
94 B
Plaintext
;; Output: 5
|
|
(do
|
|
(def y 1)
|
|
(macro m1 [x] `(do (def y 10) (assign y 4)))
|
|
(m1 8)
|
|
(+ y (m1 8))
|
|
)
|