all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: dieter@duenenhof-wilhelm.de (H. Dieter Wilhelm)
Cc: help-gnu-emacs@gnu.org
Subject: Re: Confusion about elisp symbols and defuns
Date: Wed, 24 Sep 2014 11:18:43 +0200	[thread overview]
Message-ID: <87r3z12x70.fsf@geodiff-mac3.ulb.ac.be> (raw)
In-Reply-To: <87mw9pjxd6.fsf@vsl28t2g.ww011> (H. Dieter Wilhelm's message of "Wed, 24 Sep 2014 09:23:01 +0200")

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



  reply	other threads:[~2014-09-24  9:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24  7:23 Confusion about elisp symbols and defuns H. Dieter Wilhelm
2014-09-24  9:18 ` Nicolas Richard [this message]
     [not found] <mailman.9462.1411543422.1147.help-gnu-emacs@gnu.org>
2014-09-24 12:51 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3z12x70.fsf@geodiff-mac3.ulb.ac.be \
    --to=theonewiththeevillook@yahoo.fr \
    --cc=dieter@duenenhof-wilhelm.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.