From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: Why is booleanp defined this way? Date: Fri, 17 Apr 2015 19:01:11 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1429322718 23367 80.91.229.3 (18 Apr 2015 02:05:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2015 02:05:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 18 04:05:18 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YjI8E-0006jV-7Y for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Apr 2015 04:05:18 +0200 Original-Received: from localhost ([::1]:44252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjI8D-0007Lw-5Q for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Apr 2015 22:05:17 -0400 X-Received: by 10.182.126.168 with SMTP id mz8mr8223591obb.9.1429322471914; Fri, 17 Apr 2015 19:01:11 -0700 (PDT) X-Received: by 10.50.141.134 with SMTP id ro6mr126412igb.0.1429322471898; Fri, 17 Apr 2015 19:01:11 -0700 (PDT) Original-Path: usenet.stanford.edu!l13no6603805iga.0!news-out.google.com!n7ni10009igk.0!nntp.google.com!l13no6603803iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=117.195.50.46; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 117.195.50.46 User-Agent: G2/1.0 Injection-Date: Sat, 18 Apr 2015 02:01:11 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:211511 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103793 Archived-At: On Saturday, April 18, 2015 at 2:05:11 AM UTC+5:30, Marcin Borkowski wrote: > 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, Elisp does not have a proper boolean type; unlike say symbols with symbolp, strings with stringp, numberp -- some union of numeric types etc. However programmers need boolean in their ontology even if (and even more if) the language does not support it. I'd say booleanp is a hesitant step towards supporting boolean in the ontology without supporting it in the language.