1

Why can't I expand a macro inside (quail-define-rules)?

(defmacro quail-test ()
    `("c" ["success!"]))

(quail-define-package "experiment" "Experiment" "X" t
                                            "Just an experiment."
                                            nil t t nil nil nil nil nil nil nil t)
(quail-define-rules
 ("a" ?!)
 ("b" ["circus"])
 (quail-test))
Toothrot
  • 3,204
  • 1
  • 12
  • 30
  • I'm not familiar with `quail-define-rules`, but it sounds like a problem that a lot of macros have. Well, not so much of a problem as misconception about how they must be used. The way macros are expanded is by repeatedly calling `macroexpand`, so one macro can produce a tree with macros in it, and it will be expanded on the next cycle. However, macros rarely call `macroexpand` during their own expansion. The later is uncommon, and if a macro does that, it will usually mention it in its documentation. Think about macros as defining syntax rules, then you'd see that `(quail-test)` is invalid. – wvxvw Dec 20 '17 at 06:54

0 Answers0