You must bear in mind that a macro does not evaluate its arguments unless you tell them about it. In your version, get-a receives the character m, and the result is not code, this is the keyword: a looks for itself in the character, which is obviously zero. However, this works:
(defmacro get-a [x] `(:a ~x))
The result of calling this macro with argument m is the expression '(: am)', which evaluates to 1 in your context.
source share