all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7086: `booleanp' return value is multi-valued list
@ 2010-09-22 21:58 MON KEY
  2010-09-22 22:35 ` Juanma Barranquero
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: MON KEY @ 2010-09-22 21:58 UTC (permalink / raw)
  To: 7086

"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.

Specifically that the following two forms return muti-valued lists:

 (booleanp t)
 ;=> (t)

 (booleanp nil)
 ;=> (nil t)

Additionaly, given the nature of this function and the puposes it
might serve, it
should be documented _why_ the return value is a list.

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.

    (info "(elisp)nil and t")

In lieu of this, the terseness of the `booleanp's docstring extends a
tautological
flavor which can only be met with confusion by the uninitiated.

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?

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)

(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)

Also, I find this above error troublesome given that the following
form returns:

(tt--bool-w/opt)

Whereas this one doesn't:

(defun tt--bool-nil (nil)
  (booleanp nil))

(tt--bool-nil)
;=> Debugger entered--Lisp error:
; (wrong-number-of-arguments (lambda (nil) (booleanp nil)) 0)

(tt--bool-nil 'nil)
;=> Debugger entered--Lisp error: (setting-constant nil)

And, the nature of the above errors doesn't really stand up given that:

(defun tt--bool-qt-nil (())
  (booleanp '()))

(tt--bool-qt-nil)
;=> Debugger entered--Lisp error: (wrong-number-of-arguments (lambda
(nil) (booleanp (quote nil))) 0)

(tt--bool-qt-nil nil)
;=> Debugger entered--Lisp error: (setting-constant nil)

(tt--bool-qt-nil ())
;=> Debugger entered--Lisp error: (setting-constant nil)

These last two being the most maddening.

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.

--
/s_P\





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-10-03  1:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-22 21:58 bug#7086: `booleanp' return value is multi-valued list MON KEY
2010-09-22 22:35 ` Juanma Barranquero
2010-09-23  2:06   ` Kevin Rodgers
2010-09-23 10:29     ` Juanma Barranquero
2010-10-03  1:11     ` Chong Yidong
2010-09-23  4:22   ` MON KEY
2010-09-23 10:31     ` Juanma Barranquero
2010-09-23  8:12 ` Eli Zaretskii
2010-09-24  6:41   ` MON KEY
2010-09-24  8:48     ` Juanma Barranquero
2010-09-24  9:28     ` Lawrence Mitchell
2010-09-24 22:00 ` MON KEY
2010-09-25  9:18   ` Juanma Barranquero

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.