[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why is booleanp defined this way?
From: |
Marcin Borkowski |
Subject: |
Why is booleanp defined this way? |
Date: |
Fri, 17 Apr 2015 22:34:45 +0200 |
Hi all,
this is what I found in subr.el:
,----
| (defun booleanp (object)
| "Return t if OBJECT is one of the two canonical boolean values: t or nil.
| Otherwise, return nil."
| (and (memq object '(nil t)) t))
`----
Seemingly, it doesn't make much sense: what is the purpose of saying
(and (whatever) t)
instead of just
(whatever)
for a predicate? Of course, this "normalizes" any "truthy" value to
"t", but is it really needed for anything (except perhaps being
elegant)?
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
- Why is booleanp defined this way?,
Marcin Borkowski <=
- Re: Why is booleanp defined this way?, Jorge A. Alfaro-Murillo, 2015/04/17
- Message not available
- Re: Why is booleanp defined this way?, Emanuel Berg, 2015/04/17
- Re: Why is booleanp defined this way?, Pascal J. Bourguignon, 2015/04/17
- Re: Why is booleanp defined this way?, Emanuel Berg, 2015/04/17
- Re: Why is booleanp defined this way?, Pascal J. Bourguignon, 2015/04/17
- Re: Why is booleanp defined this way?, Marcin Borkowski, 2015/04/18
- Re: Why is booleanp defined this way?, Stefan Nobis, 2015/04/18
- Re: Why is booleanp defined this way?, Emanuel Berg, 2015/04/19
RE: Why is booleanp defined this way?, Drew Adams, 2015/04/17
Re: Why is booleanp defined this way?, Tassilo Horn, 2015/04/18