'Hope it won't bother my using
defmacros named in the style of keywords (colon-prefixed, e.g.,
:get-that): it apparently tricks
ELisp from otherwise requiring
quoted symbols (
') or function symbols (
(foo :set-this value-that) ; line 0
Nevermind that: the problem goes as follows.
Say there are two "
defmacros with one parameter, and given a
cl-flet* context, there should be two similar forms (as in
line #0), but with two different macros and arguments.
An MWE is the following.
(defmacro :m (x) `(length ,x)) ; line 1 ⇒ :m (and (keywordp :m) (macrop :m)) ; line 2 ⇒ t (:m `(3)) ; line 3 ⇒ 1 (defmacro :w (x) `(length (nreverse ,x))) ; line 4 ⇒ :w (and (keywordp :w) (macrop :w)) ; line 5 ⇒ t (:w `(6)) ; line 6 ⇒ 1 (defun x (y z) (eval `(,y ,z))) ; line 7 ⇒ x (x :m `(8)) ; line 8 ⇒ Invalid function: 8 (x :w '(9)) ; line 9 ⇒ Invalid function: 8 (- (eval `(:m '(8)) (eval `(:w `(9))) ; line 10 ⇒ 0
The faulty code is in line
In these simple cases, it don't matter if the argument-list is backquoted `
'(9), or returned as
#9 show what is wrong.
#10 shows that
evaluating as it "should be" is possible.
Now, if instead of
defun there were a
(defmacro x (y z) `(eval (,y ,z))) ; line 11 ⇒ x
#9 would be equivalent to line
10, but this is impossible within a
Any hints? Thank s.