From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: Confusion about elisp symbols and defuns Date: Wed, 24 Sep 2014 11:18:43 +0200 Message-ID: <87r3z12x70.fsf@geodiff-mac3.ulb.ac.be> References: <87mw9pjxd6.fsf@vsl28t2g.ww011> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1411550422 12145 80.91.229.3 (24 Sep 2014 09:20:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2014 09:20:22 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: dieter@duenenhof-wilhelm.de (H. Dieter Wilhelm) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 24 11:20:15 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 1XWikA-00064k-9Z for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2014 11:20:14 +0200 Original-Received: from localhost ([::1]:58403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWik9-0005zS-S7 for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2014 05:20:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWijv-0005xo-Dt for help-gnu-emacs@gnu.org; Wed, 24 Sep 2014 05:20:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWijp-0001O4-Gz for help-gnu-emacs@gnu.org; Wed, 24 Sep 2014 05:19:59 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:58021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWijo-0001Ms-Au for help-gnu-emacs@gnu.org; Wed, 24 Sep 2014 05:19:53 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AksKACWLIlSkD4Xx/2dsb2JhbABghDi1fgEBAQEBAQacAwGBHgF6hAQBAQMBeQULCyElDwEEXIgpAQwIrk2MGwGIBgEXhhKCLYdfB4RLBaRRjiCDZDsvgkoBAQE Original-Received: from mathsrv4.ulb.ac.be (HELO geodiff-mac3.ulb.ac.be) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 24 Sep 2014 11:18:42 +0200 In-Reply-To: <87mw9pjxd6.fsf@vsl28t2g.ww011> (H. Dieter Wilhelm's message of "Wed, 24 Sep 2014 09:23:01 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 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:100119 Archived-At: dieter@duenenhof-wilhelm.de (H. Dieter Wilhelm) writes: > Hello (), > > Calc checks in calc-var-value if variables are bound. This works for > examplwe with the variable symbol `g' > > (calc-var-value 'g) > nil > > but bombs for the variable `v' > > (calc-var-value 'v)> => error The error is (void-function v) and that comes from the fact calc-var-value does: (set v (funcall (symbol-value v))) It does so after checking (symbolp (symbol-value v)) but does not check that this symbol indeed has a function definition. I don't know why calc-var-value does what it does, so I don't know what the fix is. Perhaps checking for (fboundp (symbol-value v)) would help a bit (or functionp instead of fboundp). OTOH, obviously calc-var-value believes that it has the right to change the value cell of its argument, so I guess calling (calc-var-value 'v) doesn't actually make sense, and there's no point in fixing calc-var-value for this specific wrong use of it. -- Nicolas Richard