emacs-devel
[Top][All Lists]
Advanced

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

Re: Macro vs Function


From: David Kastrup
Subject: Re: Macro vs Function
Date: Wed, 12 Apr 2006 11:24:16 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Herbert Euler" <address@hidden> writes:

>>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:

Which two programs?

>    (defun g ()
>      nil)
>
>    ;; macro
>    (defmacro m (a)
>      (if a
>          t
>        nil))
>    (m (g))
>
>    ;; function
>    (defun f (a)
>      (if a
>          t
>        nil))
>    (f '(g))

There is a difference between calling a macro directly, and compiling
a function refering to a macro.


-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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