From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Why is booleanp defined this way? Date: Sat, 18 Apr 2015 01:06:32 +0200 Organization: Aioe.org NNTP Server Message-ID: <877ftapd6v.fsf@debian.uxu> References: <87siby7au6.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1429311925 1228 80.91.229.3 (17 Apr 2015 23:05:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Apr 2015 23:05:25 +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 01:05:24 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 1YjFK4-00083S-Im for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Apr 2015 01:05:20 +0200 Original-Received: from localhost ([::1]:43781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjFK3-0002XE-Pc for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Apr 2015 19:05:19 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: feB02bRejf23rfBm51Mt7Q.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:OOUGvGmXKfybSpw4Hklz8AmpEIw= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:211502 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:103784 Archived-At: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) writes: >> Of course, this "normalizes" any "truthy" value to >> "t", but is it really needed for anything (except >> perhaps being elegant)? > > Perhaps so that it returns t instead of whatever, if > whatever is not nil. Yes, I think this is what the OP means by "normalizes". Normalization is a university buzzword for example in linear algebra where two vectors are normalized to a common coordination system so they can be compared. But... (booleanp t) ; t (booleanp nil) ; t (booleanp 1) ; nil! To me it looks like t and nil as arguments evaluate to t, and everything else nil - everything else that isn't evaluated first to either of t or nil, of course. The "normalization" of which you speak should rather look something like this: (defun normalize-boolean (obj) (if obj t) ) ; implicit (if obj t nil) (normalize-boolean 1) ; t (normalize-boolean nil) ; nil Or do you mean that `and' normalizes? It can, but that would depend on the order: (and 1 t) ; t (and t 1) ; 1 So I think `booleanp' shouldn't be thought of as a normalizer but rather as a type predicate, much like them `stringp', `integerp', and so on. -- underground experts united http://user.it.uu.se/~embe8573