help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Macro Expansion Inconsistency


From: Rusi
Subject: Re: Macro Expansion Inconsistency
Date: Tue, 16 Dec 2014 19:03:08 -0800 (PST)
User-agent: G2/1.0

On Wednesday, December 17, 2014 7:49:21 AM UTC+5:30, Alexander Shukaev wrote:
> How to overcome it? Do you have any further recommendations on this macro?
> 
> P.S. It's my first somewhat serious macro in Emacs Lisp ever, so I'd love
> to learn more from pros until I do something dumb.

Macros are super powerful ... and super hard.

My recommendations?
1. [Just an imperative version of Joost suggestons]:
use macroexpand to debug them ie see (info "(elisp)expansion")
ie if form is a macro-call you can debug it with
first using (macroexpand form)
and if that looks sane then
(eval (macroexpand form))
However...

2. Lisp IS Eval... its evaling all the time so you rarely need to write 'eval'
Macros are double eval-layer So you doubly dont need eval



reply via email to

[Prev in Thread] Current Thread [Next in Thread]