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: if vs. when vs. and: style question Date: Wed, 25 Mar 2015 07:02:41 -0700 (PDT) Message-ID: <0d1d19ab-06e9-462d-8867-9a49b1e232d3@googlegroups.com> References: <87sicvwckx.fsf@wmi.amu.edu.pl> <87wq27yvqg.fsf@debian.uxu> <8d531e99-7260-4263-ac99-09c6871e2708@googlegroups.com> <87vbhq53lf.fsf@debian.uxu> <87a8z23p23.fsf@kuiper.lan.informatimago.com> <87lhilx0cf.fsf@debian.uxu> <87twx9360u.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 1427292327 9120 80.91.229.3 (25 Mar 2015 14:05:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 14:05:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 25 15:05:26 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 1Yalvs-0007Mn-Ph for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Mar 2015 15:05:20 +0100 Original-Received: from localhost ([::1]:39247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yalvs-0004Vt-1k for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Mar 2015 10:05:20 -0400 X-Received: by 10.182.63.80 with SMTP id e16mr11268562obs.13.1427292161757; Wed, 25 Mar 2015 07:02:41 -0700 (PDT) X-Received: by 10.50.25.198 with SMTP id e6mr326873igg.5.1427292161699; Wed, 25 Mar 2015 07:02:41 -0700 (PDT) Original-Path: usenet.stanford.edu!z20no3149527igj.0!news-out.google.com!qk8ni67122igc.0!nntp.google.com!z20no3149520igj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <87twx9360u.fsf@kuiper.lan.informatimago.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=117.195.49.60; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 117.195.49.60 User-Agent: G2/1.0 Injection-Date: Wed, 25 Mar 2015 14:02:41 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:211034 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:103315 Archived-At: On Wednesday, March 25, 2015 at 12:49:59 PM UTC+5:30, Pascal J. Bourguignon wrote: > Rusi writes: > > > On Wednesday, March 25, 2015 at 8:10:18 AM UTC+5:30, Emanuel Berg wrote: > >> "Pascal J. Bourguignon" writes: > >> > >> > But then, why stop with +? > >> > > >> > You could use instead: > >> > > >> > (funcall (additive-operator (ring integer)) > >> > (neutral-element (multiplicative-operator (ring > >> > integer))) 5) ; 6 > >> > > >> > or something even more general? > > > > I find Pascal's example brilliant and hilarious. > > In this case though, I slightly err on your (Emanuel) side. > > > > When I see the 1+, I have a stop (like um... er...) > > Is that a number, an expression, a constant, a comment? > > > > Oh Oh.. Functions can start with digits (Yeah this is lisp...) > > > Indeed, it is clear that the names 1+ and 1- are ill-choosen. > Notably 1-!!! > > (1- x) == (- x 1) > > > BUT > > Those are actually fundamental operators, more fundamental than addition > and substration, both in a theoric way, and in practice with a lot of > processors. > > They are the operators named succ(x) and pred(x) in pascal (which C > lacks as independent operators, but have combined with updating with the > pre- and post- complifications of ++x, x++, --x, and x--; C is THE crazy > language). > > > In axiomatic number/set theory, we only assume a number noted 0, and a > succ(x) operation that let us build a new number from any number x. > > so 1 = succ(0) by definition. (= 1 (1+ 0)) > > You do not program it the other way around, defining 1+ from x and 1, > you define 1 from 1+ and 0! > > And the proof, is that processors usually have an increment and a > decrement operation even while they may lack a general load operation > (working or any immediate word-sized number). > > So when you write x:=512; you may actually obtain a "load #511; incr" > instruction sequence, ie. (1+ 511). > > > > So write: > > (defun succ (x) (1+ x)) > (defun pred (x) (1- x)) > > or in elisp: > > (defalias 'succ '1+) > (defalias 'pred '1-) > > and use (succ x) instead of (1+ x) or (+ x 1). > > > (Remember that the only literal numbers allowed in a program source are > 0 and 1; well, it's even better if you allow only 0 and (succ x)). You are in a funny mood today Pascal!! Yeah I know that math pre-exists the universe... And arithmetic is core math And Peano's axioms are the heart of arithmetic Yeah Yeah I know I know... Still choosing identifiers in a programming language (even Lisp!) to align with Peano's axioms seems a bit much... Dont you think? On a different note... For 50 years CS has been living in the impoverished world of ASCII. This makes people think CS and math are more far apart than they essentially/really are. I wrote this as my wish for python: http://blog.languager.org/2014/04/unicoded-python.html Isn't it about time lisp also considered a similar line?