emacs-devel
[Top][All Lists]
Advanced

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

Re: Macro vs Function


From: Herbert Euler
Subject: Re: Macro vs Function
Date: Wed, 12 Apr 2006 17:17:19 +0800

From: David Kastrup <address@hidden>
To: "Herbert Euler" <address@hidden>
CC: address@hidden
Subject: Re: Macro vs Function
Date: Wed, 12 Apr 2006 11:07:48 +0200

The macro is executed at function definition time, the function
at execution time.

Sorry I don't quite understand this.  Could you please explain it?
Thanks.  But the following two programs seem to be same:

   (defun g ()
     nil)

   ;; macro
   (defmacro m (a)
     (if a
         t
       nil))
   (m (g))

   ;; function
   (defun f (a)
     (if a
         t
       nil))
   (f '(g))

And, these two seem to be same as well:

   ;; macro
   (defmacro m (a)
     (if (eval a)
         t
       nil))
   (m (g))

   ;; function
   (defun f (a)
     (if (eval a)
         t
       nil))
   (f '(g))

Regards,
Guanpeng Xu

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

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