From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: About `funcall' Date: Mon, 04 Mar 2013 15:11:47 +0100 Message-ID: <87r4jvl0f0.fsf@web.de> References: <51349923.4030307@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362406211 30095 80.91.229.3 (4 Mar 2013 14:10:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Mar 2013 14:10:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 04 15:10:33 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCW62-0008Lj-Cz for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Mar 2013 15:10:30 +0100 Original-Received: from localhost ([::1]:45540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCW5g-0002fJ-UC for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Mar 2013 09:10:08 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCW5V-0002f7-DS for help-gnu-emacs@gnu.org; Mon, 04 Mar 2013 09:09:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCW5U-0008Ao-9F for help-gnu-emacs@gnu.org; Mon, 04 Mar 2013 09:09:57 -0500 Original-Received: from mout.web.de ([212.227.15.3]:63884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCW5U-000869-0U for help-gnu-emacs@gnu.org; Mon, 04 Mar 2013 09:09:56 -0500 Original-Received: from drachen.dragon ([92.74.177.220]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0Lw0ht-1UrOkp0PZV-018IcG; Mon, 04 Mar 2013 15:09:54 +0100 Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: (Xue Fuqiao's message of "Mon, 04 Mar 2013 20:57:30 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V02:K0:EXpx3bM2bF6AbjFYQkhZ/gcWHJRNfFPZU8sTPZkabu/ +avb8CZFuA00jLhDS4+3D9nVZzDF/KwTC+C6Md5ZKUHKMDx/zT AkBCR+AfCYE/IRWnQFIr+KfRmihYN7mMSTu6n6B4kzQlrN+3L3 Qz2siWxB/Rtc2afYsPKjYo8Ch2N1nrr0Do/H3TEKfElCDH73aq hLBNakGtE6JrmMLljaxjypddUq6E7kSMyidyVLhDhA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89338 Archived-At: Xue Fuqiao 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.