Skip to content
This repository has been archived by the owner on May 23, 2021. It is now read-only.

Macro expansion mutates original list #17

Open
spy16 opened this issue Mar 1, 2020 · 0 comments
Open

Macro expansion mutates original list #17

spy16 opened this issue Mar 1, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@spy16
Copy link
Owner

spy16 commented Mar 1, 2020

  1. define a macro that returns [] on expansion : (def my-macro (macro* [& rest] []))
  2. create a list that would invoke my-macro when evaluated: (def a-list '(my-macro 1 2 "hello"))
  3. a-list represents the list (my-macro 1 2 "hello")
  4. evaluate the list: (eval a-list)
  5. check the value of a-list which is now result of macro expansion (i.e., (do [])) instead of its original value (my-macro 1 2 "hello").
@spy16 spy16 added the bug Something isn't working label Mar 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant