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

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

Re: About `funcall'


From: Michael Heerdegen
Subject: Re: About `funcall'
Date: Mon, 04 Mar 2013 15:11:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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

> On 03/04/2013 08:52 PM, Xue Fuqiao wrote:
> > 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.
>
> Maybe the first argument is whatever the `or' expression
> returns, so the remaining arguments are passed to it?

Exactly.  Note that `funcall' is a _function_, so it evaluates all
arguments first.  The first argument should evaluate to a function,
which is then called with the remaining arguments.

This is useful, because unlike in scheme, this:

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

won't work in Emacs Lisp.

Note that `apply' behaves analogously, because it's also a function.


Regards,

Michael.



reply via email to

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