From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith Wright Newsgroups: gmane.lisp.guile.user Subject: Re: 1+ is not R5RS Date: Thu, 18 Dec 2008 23:24:25 -0500 Message-ID: <200812190424.mBJ4OPEG003963@fcs13.keithdiane.us> References: <494A696D.3080201@organum.hu> <87ljud2nrt.fsf@gnu.org> <878wqd3ykl.fsf@unknownlamer.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1229659193 17240 80.91.229.12 (19 Dec 2008 03:59:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Dec 2008 03:59:53 +0000 (UTC) Cc: clinton@unknownlamer.org, ludo@gnu.org To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Dec 19 05:01:00 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LDWXr-0003Fl-BM for guile-user@m.gmane.org; Fri, 19 Dec 2008 05:00:59 +0100 Original-Received: from localhost ([127.0.0.1]:43957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDWWf-0003kB-1J for guile-user@m.gmane.org; Thu, 18 Dec 2008 22:59:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LDWWa-0003hU-NR for guile-user@gnu.org; Thu, 18 Dec 2008 22:59:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LDWWY-0003gi-3q for guile-user@gnu.org; Thu, 18 Dec 2008 22:59:39 -0500 Original-Received: from [199.232.76.173] (port=55640 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDWWY-0003gf-0N for guile-user@gnu.org; Thu, 18 Dec 2008 22:59:38 -0500 Original-Received: from mail6.sea5.speakeasy.net ([69.17.117.8]:38598) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LDWWX-0003v9-HK for guile-user@gnu.org; Thu, 18 Dec 2008 22:59:37 -0500 Original-Received: (qmail 26305 invoked from network); 19 Dec 2008 03:58:43 -0000 Original-Received: from dsl.keithdiane.us (HELO fcs12.keithdiane.us) ([66.92.74.188]) (envelope-sender ) by mail6.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 19 Dec 2008 03:58:42 -0000 Original-Received: from fcs13.keithdiane.us (fcs13 [192.168.1.112]) by fcs12.keithdiane.us (Postfix) with ESMTP id 3ADF9228350; Thu, 18 Dec 2008 22:58:55 -0500 (EST) Original-Received: from fcs13.keithdiane.us (localhost.localdomain [127.0.0.1]) by fcs13.keithdiane.us (Postfix) with ESMTP id 2F98CAF4043; Thu, 18 Dec 2008 23:24:32 -0500 (EST) Original-Received: (from kwright@localhost) by fcs13.keithdiane.us (8.13.1/8.13.1/Submit) id mBJ4OPEG003963; Thu, 18 Dec 2008 23:24:25 -0500 X-Authentication-Warning: fcs13.keithdiane.us: kwright set sender to kwright@keithdiane.us using -f In-reply-to: <878wqd3ykl.fsf@unknownlamer.org> (message from Clinton Ebadi on Thu, 18 Dec 2008 17:31:22 -0500) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7018 Archived-At: > From: Clinton Ebadi > Cc: guile-user@gnu.org > > ludo@gnu.org (Ludovic Courtès) writes: > > "Bertalan Fodor (LilyPondTool)" writes: > >> Could you provide me some background why 1+ exists, as it is the same > >> as (+ 1, and why is it named like this? > > > > It'll be hard to get a definite answer: these procedures have "always" > > been there, at least since [1996] > > That's a long time ago... > > Probably because Common Lisp has 1+ and 1-. I think it was longer ago than that. Maybe closer to 1969 than 1996. Some LISP 1.5 programmer got tired of typing (add1 x) and (sub1 x) to get the successor and predecessor of x, and noticed that (1+ x), except for spacing, looks just like infix notation. Cool. Remember, at that time the straightforward way to write it out in full was not (+ 1 x), but (plus x 1). Use of function names that are not alphanumeric is a "modern" innovation. Unfortunately, predecessor doesn't work out so well. You can change "+" to "-", and get (1- x) for predecessor, but read as infix notation that is exactly backward. It would work to write (-1+ x), but now it is as troublesome to type as (sub1 x). We never liked infix all that much, so we go with "consistency". If I had it to do over, I would pick (define (++ x) (+ x 1)) (define (-- x) (- x 1)) but all this happened before C was a gleam in K&R's eyes, and so that was not obvious back then. -- Keith