spy16 / sabre

Sabre is highly customisable, embeddable LISP engine for Go. :computer:
GNU General Public License v3.0
28 stars 5 forks source link

Macro expansion mutates original list #17

Open spy16 opened 4 years ago

spy16 commented 4 years ago
  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").