I thought symbol-macros are like function-like macros, but they only substitute single symbols to expressions, if they are not interpreted as functions or macros.
lets define the symbol-macro as
maybe this is, because it is a special form
but then it is wierd that this special form
I also can not make the symbol-macro unbound again, as with normal macros, and functions (fmakunbound) and symbols, following code throws an error:
Another example:
but if I write the macro-expansion of test in the last function:
why are symbol macros setq-able?
lets define the symbol-macro as
(define-symbol-macro macro 0)
so the form
(let ((macro 1)) macro)
would expand to
(let ((0 1)) 0)
and throw an error but it evals to 1maybe this is, because it is a special form
but then it is wierd that this special form
(setq macro 1)
is not possibleI also can not make the symbol-macro unbound again, as with normal macros, and functions (fmakunbound) and symbols, following code throws an error:
(fmakunbound macro)
how can I do this?Another example:
(defvar *cons* (cons 1 2))
(define-symbol-macro test (car *cons*))
(setq test 0)
now cons is "(0 . 2)"but if I write the macro-expansion of test in the last function:
(setq (car *cons*) 1)
it is, like expected, not possible, and throws an errorwhy are symbol macros setq-able?