From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Re: Function pointer Date: Tue, 14 Apr 2009 01:41:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1ca52c6e-ca27-4ffe-aa95-27b9bbfebe61@z14g2000yqa.googlegroups.com> References: <43154d5e-b73a-4fd6-b4aa-3bb4027cb409@z9g2000yqi.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1239702399 24016 80.91.229.12 (14 Apr 2009 09:46:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Apr 2009 09:46:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 14 11:47:57 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LtfFC-0002kD-H1 for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Apr 2009 11:47:54 +0200 Original-Received: from localhost ([127.0.0.1]:55095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtfDn-0000xJ-Lu for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Apr 2009 05:46:27 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z14g2000yqa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: posting.google.com 1239698477 27989 127.0.0.1 (14 Apr 2009 08:41:17 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 14 Apr 2009 08:41:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z14g2000yqa.googlegroups.com; posting-host=84.53.123.169; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.0.8) Gecko/2009032608 Firefox/3.0.8,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:168450 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63727 Archived-At: On 14 apr, 10:02, Harald Hanche-Olsen wrote: > + Decebal : > > The following works: > > =A0 =A0 (a-function) > > but this does not work: > > =A0 =A0 (setq function 'a-function) > > =A0 =A0 (function) > > this gives wrong number of arguments. > > Ah. So you're not after pointers, just a means of passing functions > around. You should be aware, then, that symbols can have two values > associated with them: The regular value, which is obtained by just using > the symbol, and the function value, which is consulted if the symbol is > in the function place of a for. You have assigned the symbol a-function > to the symbol function above, but that symbol also has a function value, > which you inadvertently used in the last line. > > The elisp manual explains this. Go to node Symbols, then sub-node Symbol > Components. > > The very short answer to your question: Use funcall, as in > =A0 =A0 (funcall function) Works likes a charm. Now I have the tools to build the 'little' functionality I wanted. Thanks.