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 22:00:34 -0700 (PDT) Message-ID: References: <87twwemaxx.fsf@debian.uxu> <138bf565-898d-4b5a-8bea-eecd223c652b@googlegroups.com> <877ftam61r.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1429333528 10502 80.91.229.3 (18 Apr 2015 05:05:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2015 05:05:28 +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 07:05:28 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 1YjKwX-0002gv-BH for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Apr 2015 07:05:25 +0200 Original-Received: from localhost ([::1]:44517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjKwW-0004XX-Ev for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Apr 2015 01:05:24 -0400 X-Received: by 10.236.222.103 with SMTP id s97mr8565125yhp.19.1429333235583; Fri, 17 Apr 2015 22:00:35 -0700 (PDT) X-Received: by 10.50.97.104 with SMTP id dz8mr25371igb.10.1429333235557; Fri, 17 Apr 2015 22:00:35 -0700 (PDT) Original-Path: usenet.stanford.edu!z60no2381870qgd.0!news-out.google.com!db6ni18721igc.0!nntp.google.com!l13no6638750iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <877ftam61r.fsf@kuiper.lan.informatimago.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=61.1.37.7; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 61.1.37.7 User-Agent: G2/1.0 Injection-Date: Sat, 18 Apr 2015 05:00:35 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:211523 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:103806 Archived-At: On Saturday, April 18, 2015 at 9:47:41 AM UTC+5:30, Pascal J. Bourguignon wrote: > Rusi writes: > > >> I never used `booleanp' and I never experienced that > >> the boolean built-in type was missing from my > >> "ontology". > > > > If you how to write (and grok) an 'if' you have boolean in your > > ontology. > > Not exactly. There's something magical occuring in if. > > if takes an expression that is _used_ _as_ a condition. > > Often, that expression is a boolean, but that depends on the > language. For example, in C, the expression is any expression, and it is > tested against 0 to define the (negation of the) condition. > > You could define a language without ANY predefined types, and then you > would have to declare the mapping between the values of some > user-defined type and the condition used by any "conditional" > instruction or operator. > > (deftype booleen () `(member vrai faux)) > > (declare-if-conditions :then (eql vrai) > :else (eql faux)) > > (if t 'yes 'no) --> # > (if 'vrai 'yes 'no) --> yes > > > (declare-if-conditions :else (function zerop)) > > (if 'vrai 'yes 'no) --> # > (let ((a 2)) (if (- a 2) 'yes 'no)) --> yes > > (Of course, it is not too useful to have such things in lisp, we're > happy with generalized booleans, but once upon a time, I fancied a > language with no predefined types, as a way to achieve better > portability. Like C is "good" for I/O by reason of having no I/O > operator (compared to eg. Pascal), a typeless static language would be > good for portability, because it would have no implicit dependence on > the processor data types such as int32 or int64; you'd declare your own > integer ranges and the compilers would ensure it works everywhere. > > (deftype my-int () `(integer -20 1000000)) > (let ((a 0)) > (declare (type (my-int a))) > (incf a)) > > But again, for lisp or any other non-statically typed programming > language, this is mute. I know very little CL so dont really get what you are saying. Can you say it in scheme? (ironical on this thread!)