help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: if vs. when vs. and: style question


From: Pascal J. Bourguignon
Subject: Re: if vs. when vs. and: style question
Date: Fri, 27 Mar 2015 13:41:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

<tomas@tuxteam.de> writes:

> On Fri, Mar 27, 2015 at 08:59:25AM +0100, Gian Uberto Lauri wrote:
>> Emanuel Berg writes:
>>  >  (1+ data) vs. (+ 1 data)
>> 
>> I miss the original discussion, my apologies.
>> 
>> In C, increment and decrement operators are meant to use hw processor
>> instructions.
>> 
>> Is it the same for the LISP 1+ function?
>
> That depends on the compiler. OTOH -- for a decent modern compiler, the
> code generator would see the same, whether you type (+ 1 foo) or (1+ foo).
>
> The optimizer is solving much harder problems than that. This holds true
> for C as it holds for Lisp or Scheme or whatnot.


Definitely.  
And this would be a good argument to remove/avoid 1+ and 1-.

(But remember, in my opinion, those are SUCC and PRED, and therefore
their presence represents a more fundamental idea; on the other hand a
lisp function named SUCC could like in pascal, obtain the successor
character too).

Again, one could argue indeed that it's a premature optimization: CL is
specified to be able to write very different implementation, very small
and simple implementations are possible, as well as very big and very
sophisticated ones.  Interpreters or compilers are possible.  (Already,
I feel there is more diversity in CL implementations than in C, even
taking into account Cint).


Some systems such as ACL2 are based on a subset of CL, using the list
notation even for arrays.   If we augment generality of principle, can
we remove specific and specialized operators.  In the end, we can reduce
all programming to lambda calculus.  There's a whole spectrum and the
question is where you put the cursor.


-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


reply via email to

[Prev in Thread] Current Thread [Next in Thread]