From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Refer to List of Arguments in Emacs Lisp Function Date: Thu, 13 Nov 2014 17:16:52 +0100 Message-ID: <87389nulcb.fsf@wmi.amu.edu.pl> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415895455 23946 80.91.229.3 (13 Nov 2014 16:17:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2014 16:17:35 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 13 17:17:29 2014 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 1Xox5L-0005da-QP for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Nov 2014 17:17:27 +0100 Original-Received: from localhost ([::1]:60825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xox5L-0005jN-92 for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Nov 2014 11:17:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xox51-0005ZL-Qe for help-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:17:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xox4v-0002ta-Rz for help-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:17:07 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:54114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xox4v-0002tJ-Cb for help-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:17:01 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 045DD4207A for ; Thu, 13 Nov 2014 17:16:59 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id U6+1B8nCi2GM for ; Thu, 13 Nov 2014 17:16:58 +0100 (CET) Original-Received: from localhost (unknown [150.254.82.23]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 8565142079 for ; Thu, 13 Nov 2014 17:16:58 +0100 (CET) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 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:100915 Archived-At: On 2014-11-13, at 09:02, Alexander Shukaev wrote: > Hello, > > I can't find whether there is a possibility to refer to the whole list of > arguments of a function in Emacs Lisp. For example: > > (defun move (x y z) > (apply do-move (args)) > > What I mean by (args) primitive here is a list (x y z). This use case > illustrates usefulness of such a primitive, i.e. forwarding of arguments to > another internal call without a need to rewrite them by hand. (length > (args)) might be useful in some cases too. Is there anything like that in > Emacs Lisp already? (defun move (&rest args) (apply #'do-move args)) Note that (apply do-move (args)) would not work: first, you have to quote do-move, second, (args) would try to call a function `args'. Hth, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University