[Top][All Lists]

[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 18:59:45 +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 17:29:40 +0200
>>Why are you bothering with "apply" in the first place?  It does not
>>look like you have any need for it.  Just write
> Because func is supposed to be a variable set by, for instance,
>    (setq f '+)
> And '+ is just for testing purpose.

Could you _please_ quote the relevant definitions when answering?  It
causes a lot of extra work if I have to go constantly to previous
parts of the thread to dig them out.  I still don't see why you can't
just write

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

Or, if you really insist on "apply",

(defmacro xgp-casi2-safe-call-iter (func largs)
 (and largs
     `(condition-case nil
           (apply ,func (list ,@(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]