From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.help Subject: Re: Function pointer Date: Tue, 14 Apr 2009 10:02:12 +0200 Organization: Norwegian university of science and technology Message-ID: References: <43154d5e-b73a-4fd6-b4aa-3bb4027cb409@z9g2000yqi.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1239698637 11979 80.91.229.12 (14 Apr 2009 08:43:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Apr 2009 08:43:57 +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 10:45:16 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 1LteGO-0000Ye-7A for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Apr 2009 10:45:04 +0200 Original-Received: from localhost ([127.0.0.1]:38052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LteEz-0005nJ-Kc for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Apr 2009 04:43:37 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!uio.no!ntnu.no!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: fiinbeck.math.ntnu.no Original-X-Trace: orkan.itea.ntnu.no 1239695944 12639 129.241.15.140 (14 Apr 2009 07:59:04 GMT) Original-X-Complaints-To: usenet@ntnu.no Original-NNTP-Posting-Date: Tue, 14 Apr 2009 07:59:04 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) Cancel-Lock: sha1:qHOufPZCx8XfU55C5Hmam3VUw6c= Original-Xref: news.stanford.edu gnu.emacs.help:168449 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:63726 Archived-At: + Decebal : > Is it possible to work with function pointers? No. Pointers are a low level concept not supported by elisp. > The following works: > (a-function) > but this does not work: > (setq function 'a-function) > (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 (funcall function) -- * Harald Hanche-Olsen - It is undesirable to believe a proposition when there is no ground whatsoever for supposing it is true. -- Bertrand Russell