Re: Should (boundp object) be tested and what would it mean

Stefan Monnier via Users list for the GNU Emacs text editor <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
> (defun lana-obnam (object)
>   "Return variable/symbol NAME holding OBJECT."

The variable named `object` is the one holding OBJECT.
You can't test OBJECT to find if some other variable may hold it
as well.

>   (cond
>     ((symbolp object)  (symbol-name object))

Here, you're returning the name of OBJECT when OBJECT is a symbol.
But that doesn't mean that the variable of that name (if it exists)
holds OBJECT (unless OBJECT is a symbol whose value is itself, which is
unusual but does occur occasionally).


=== Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.