bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7086: `booleanp' return value is multi-valued list


From: Kevin Rodgers
Subject: bug#7086: `booleanp' return value is multi-valued list
Date: Wed, 22 Sep 2010 20:06:02 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

On 9/22/10 4:35 PM, Juanma Barranquero wrote:
On Wed, Sep 22, 2010 at 23:58, MON KEY<monkey@sandpframing.com>  wrote:

"Return non-`nil' if OBJECT is one of the two canonical boolean
  values: `t' or `nil'."

It should be documented both in the manual and the docstring of `booleanp' that
its return value is a list.

Why? It is a type predicate. If anything, it should be changed to
return t or nil, as "(elisp)2.6 Type Predicates" says:

      A type predicate function takes one argument; it returns `t' if the
   argument belongs to the appropriate type, and `nil' otherwise.

The fact that it returns nil or a list is an implementation detail.

Indeed, while I can appreciate why (booleanp nil) returns a two element list
I'm unable to reason a rationale for why (booleanp t) doesn't?

Why do you expect any kind of rationale, other than the simple fact
that it is implemented as

   (memq object '(nil t)))

(and (memq object '(nil t))
     t)

would be better.

--
Kevin Rodgers
Denver, Colorado, USA






reply via email to

[Prev in Thread] Current Thread [Next in Thread]