From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#7086: `booleanp' return value is multi-valued list Date: Thu, 23 Sep 2010 10:12:28 +0200 Message-ID: <83pqw4vpxv.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1285231303 13458 80.91.229.12 (23 Sep 2010 08:41:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2010 08:41:43 +0000 (UTC) Cc: 7086@debbugs.gnu.org To: MON KEY Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 23 10:41:41 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OyhN4-0003Lx-Ud for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Sep 2010 10:41:39 +0200 Original-Received: from localhost ([127.0.0.1]:50205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyhN4-0000iR-Fw for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Sep 2010 04:41:38 -0400 Original-Received: from [140.186.70.92] (port=53125 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyhMW-0000Ym-AO for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 04:41:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyhMU-00048I-OL for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 04:41:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54854) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyhMU-000484-Gs for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 04:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OygtR-0000rE-Uu; Thu, 23 Sep 2010 04:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Sep 2010 08:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 7086-submit@debbugs.gnu.org id=B7086.12852294373286 (code B ref 7086); Thu, 23 Sep 2010 08:11:01 +0000 Original-Received: (at 7086) by debbugs.gnu.org; 23 Sep 2010 08:10:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oygt3-0000qx-Mr for submit@debbugs.gnu.org; Thu, 23 Sep 2010 04:10:37 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oygt0-0000qs-Rh for 7086@debbugs.gnu.org; Thu, 23 Sep 2010 04:10:36 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L9600100XEHT200@a-mtaout20.012.net.il> for 7086@debbugs.gnu.org; Thu, 23 Sep 2010 10:12:27 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.203.3]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L960012JXGOTF00@a-mtaout20.012.net.il>; Thu, 23 Sep 2010 10:12:25 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 23 Sep 2010 04:11:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:40371 Archived-At: > Date: Wed, 22 Sep 2010 17:58:12 -0400 > From: MON KEY > Cc: > > "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. The precise form of the return value is an implementation detail. Such details need not be documented. Are there any _real-life_ use cases where this matter? > Additionaly, given the nature of this function and the puposes it > might serve, it > should be documented _why_ the return value is a list. Implementation details don't need to be documented, unless they really matter to Lisp programs which use these APIs. > Frustratingly, while the manual waxes on about the readers interpretation of > fundamental identity equivalence w/re `nil' and `()' and their self evaluating > specialness it has frightening little to offer w/re how one should reflect on > these things values within lisp programs. The manual is not a guide to reflections. Please explain what is missing, exactly. > 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? Again, why is it important? > Also, there is this goofiness: > > (defun tt--bool-w/opt (&optional x) > (booleanp x)) > > (tt--bool-w/opt nil) ;=> (nil t) > (tt--bool-w/opt t) ;=> (t) > (tt--bool-w/opt) ;=> (nil t) See (info "(elisp)Argument List") for an instant enlightening: omitted optional arguments default to nil. > (defun tt--bool (x) > (booleanp x)) > > (tt--bool nil) ;=> (nil t) > (tt--bool t) ;=> (t) > (tt--bool 'nil) ;=> (nil t) > (booleanp '()) ;=> (nil t) > (booleanp ()) ;=> (nil t) > > (tt--bool) > ;=> Debugger entered--Lisp error: > ; (wrong-number-of-arguments (lambda (x) (booleanp x)) 0) Exactly! See the above node in the manual. But this has nothing to do with booleanp. > Emacs lets me define the function but then accuses me of somthing I didn't even > (appear) to do, i.e. set the constant nil. Emacs gives you enough rope to hang yourself; don't do that, unless you mean it.