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

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

Re: About `funcall'


From: Xue Fuqiao
Subject: Re: About `funcall'
Date: Tue, 05 Mar 2013 06:59:37 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3

Xue Fuqiao <xfq.free@gmail.com> writes:

In `yank-pop', there is an sexp about `funcall':

  (funcall (or yank-undo-function 'delete-region) (point) (mark t))

IIRC the first argument for `funcall' should be a function, so I'm
confused with this usage.  Can somebody explain it to me?  Thanks.

`or' returns the first argument that is not nil, or nil when all the
arguments are nil.

I see, thanks.

    (defmacro .or (&rest args)
      (if (null args)
         'nil
         (let ((var (gensym)))
          `(let ((,var ,(first args)))
             (if ,var
                ,var
                (.or ,@(rest args)))))))

    (macroexpand '(.or a b))
    --> (let ((#1=#:G90861 a)) (if #1# #1# (\.or b)))--

What does "(first args)" mean here?  Does it mean "(car args)"?



reply via email to

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