From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Elisp / C inconsistency for reading "1." Date: Sat, 15 Mar 2014 17:43:44 +0100 Organization: Organization?!? Message-ID: <87siqje7jz.fsf@fencepost.gnu.org> References: <53231298.9090905@cs.ucla.edu> <85vbvf8m3j.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1394901840 22405 80.91.229.3 (15 Mar 2014 16:44:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Mar 2014 16:44:00 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 15 17:44:09 2014 Return-path: Envelope-to: ged-emacs-devel@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 1WOrgt-00084h-Mi for ged-emacs-devel@m.gmane.org; Sat, 15 Mar 2014 17:44:07 +0100 Original-Received: from localhost ([::1]:50631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOrgt-0000PI-9r for ged-emacs-devel@m.gmane.org; Sat, 15 Mar 2014 12:44:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOrgl-0000Oy-SU for emacs-devel@gnu.org; Sat, 15 Mar 2014 12:44:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOrgg-0005BC-Pg for emacs-devel@gnu.org; Sat, 15 Mar 2014 12:43:59 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOrgg-0005B5-Ij for emacs-devel@gnu.org; Sat, 15 Mar 2014 12:43:54 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WOrgf-0007sb-Iq for emacs-devel@gnu.org; Sat, 15 Mar 2014 17:43:53 +0100 Original-Received: from x2f4748c.dyn.telefonica.de ([2.244.116.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 15 Mar 2014 17:43:53 +0100 Original-Received: from dak by x2f4748c.dyn.telefonica.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 15 Mar 2014 17:43:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 71 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: x2f4748c.dyn.telefonica.de X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:6VcQK0viuHEs6cYHUD0KN2+AQ8E= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:170396 Archived-At: Wolfgang Jenkner writes: > On Fri, Mar 14 2014, Stefan wrote: > >>> More important, it feels wrong coming from a Lisp background, as Common Lisp >>> and Scheme both interpret "1." to be a floating point number. I would >>> support changing Emacs Lisp to be consistent with common practice, as there >>> seems no point to being different and there are advantages to being >>> consistent. (Not during the feature freeze though, of course.) >> >> I'd tend to agree, indeed. > > But please don't base your opinion on a wrong assumption about Common > Lisp, see [1], > > Integers can be written as a sequence of digits [...] > optionally followed by a decimal point; > > And, to be really pedantic, let's add that `integer' and `float' are > disjoint types, see [2], > > The types rational and float are disjoint subtypes of type real. > > and [3], > > The types integer and ratio are disjoint subtypes of type > rational. > > This remark is actually pertinent here, because the emacs CL package > seems to emulate these type relations (as far as corresponding objects > exist in emacs-lisp). > > (cl-typep 1. 'integer) > => t > (cl-typep 1. 'float) > => nil > > [1] http://www.lispworks.com/documentation/HyperSpec/Body/02_cbaa.htm > [2] http://www.lispworks.com/documentation/HyperSpec/Body/t_real.htm > [3] http://www.lispworks.com/documentation/HyperSpec/Body/t_ration.htm And indeed: $ clisp i i i i i i i ooooo o ooooooo ooooo ooooo I I I I I I I 8 8 8 8 8 o 8 8 I \ `+' / I 8 8 8 8 8 8 \ `-+-' / 8 8 8 ooooo 8oooo `-__|__-' 8 8 8 8 8 | 8 o 8 8 o 8 8 ------+------ ooooo 8oooooo ooo8ooo ooooo 8 Welcome to GNU CLISP 2.49 (2010-07-07) Copyright (c) Bruno Haible, Michael Stoll 1992, 1993 Copyright (c) Bruno Haible, Marcus Daniels 1994-1997 Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998 Copyright (c) Bruno Haible, Sam Steingold 1999-2000 Copyright (c) Sam Steingold, Bruno Haible 2001-2010 Type :h and hit Enter for context help. [1]> 1. 1 [2]> 1.0 1.0 [3]> -- David Kastrup