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

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

Re: What is the best way to navigate #ifdef and #endif in C program


From: Pascal J. Bourguignon
Subject: Re: What is the best way to navigate #ifdef and #endif in C program
Date: Wed, 08 Dec 2010 15:23:30 -0000
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.2 (gnu/linux)

Elena <egarrulo@gmail.com> writes:

> On Aug 6, 10:43 am, Pascal Costanza <p...@p-cos.net> wrote:
>> Here is a way how to do TCO in Common 
>> Lisp:http://groups.google.com/group/comp.lang.lisp/msg/8f9dcf58a00aca27
>>
>> It can't be implemented as just a macro, because it requires the
>> cooperation of different parts of a program. You can only do that as a
>> "real" language extension.
>
> Thanks for the link, Pascal.
>
> IMHO, that would be a better way to make TCO available, that is: TCO
> should be explicit, since you know beforehand whether you want your
> function to be tail recursive or not. Then, whenever you fail to
> implement a tail recursion among mutually recursive functions, the
> compiler should complain. If I'm not mistaken, OCaml has (somewhat)
> explicit TCO. Or detecting such errors would better be left to test
> cases?

You're all forgetting something.  

In Common Lisp, most tail calls ARE NOT tail calls.

This is because of dynamic binding.  Not only of variables, but also
of unwind frames, a lot of them are hidden in with-* macros, catch
frames, condition handlers, restarts, etc.

So even if TCO was mandatory, it couldn't be applied often in Common
Lisp programs.



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


reply via email to

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