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 17:29:40 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Herbert Euler" <address@hidden> writes:

> What I'm trying to do can be found at
>
>    http://lists.gnu.org/archive/html/help-gnu-emacs/2006-04/msg00185.html
>
> The reason why ,(car largs) is not sufficient is that 'apply' requires
> a list as the last argument. While I call 'xgp-casi2-safe-call-iter' with
>
>    (xgp-casi2-safe-call-iter '+ ((1 2 a) (3 4)))
>
> (car largs) is (1 2 a), which it's not a list when evaluating
>
>    (apply '+ (1 2 a))
>
> (I've modified xgp-casi2-safe-call but it's not accessible now.  I'll
> post it when
> it's accessible.)

Why are you bothering with "apply" in the first place?  It does not
look like you have any need for it.  Just write

(defmacro xgp-casi2-safe-call-iter (func largs)
 (and largs
     `(condition-case nil
           (,func ,@(car largs))
         (error (xgp-casi2-safe-call-iter ,func ,(cdr largs))))))

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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