Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VHDL: defmacro! doesn't modify existing functions #604

Open
peepo opened this issue Jan 11, 2022 · 1 comment
Open

VHDL: defmacro! doesn't modify existing functions #604

peepo opened this issue Jan 11, 2022 · 1 comment

Comments

@peepo
Copy link

peepo commented Jan 11, 2022

I am just beginning to review the VHDL version,
please could this expression be elaborated?
ie is this a defect of the implementation?
or what is the reason for its inclusion?
It has been applied to three of the tests, does it perhaps mean different things?
etc.
thanks!

@dubek
Copy link
Collaborator

dubek commented Jan 12, 2022

I think you're referring to the change in PR #532: before this fix, the two final (optional) tests of in tests/stepA_mal.mal failed:

;;
;; Test that defining a macro does not mutate an existing function.
(def! f (fn* [x] (number? x)))
(defmacro! m f)
(f (+ 1 1))
;=>true
(m (+ 1 1))
;=>false

That PR fixed this by creating a copy of the function given to defmacro!, and only modifying that copy to be a macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants