[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/
- Re: [OT] Re: What is the best way to navigate #ifdef and #endif in C program, (continued)
- Re: [OT] Re: What is the best way to navigate #ifdef and #endif in C program, Pascal J. Bourguignon, 2010/12/08
- Re: What is the best way to navigate #ifdef and #endif in C program, Elena, 2010/12/08
- Re: What is the best way to navigate #ifdef and #endif in C program, Arzobispo Andante, 2010/12/09
- Re: What is the best way to navigate #ifdef and #endif in C program, Peter Keller, 2010/12/09
- Re: What is the best way to navigate #ifdef and #endif in C program, Elena, 2010/12/08
- Re: What is the best way to navigate #ifdef and #endif in C program, Elena, 2010/12/08
- Re: What is the best way to navigate #ifdef and #endif in C program, Peter Keller, 2010/12/09
- Re: What is the best way to navigate #ifdef and #endif in C program, Pascal J. Bourguignon, 2010/12/08
- Re: What is the best way to navigate #ifdef and #endif in C program, Pascal Costanza, 2010/12/09
- Re: What is the best way to navigate #ifdef and #endif in C program, Elena, 2010/12/08
- Re: What is the best way to navigate #ifdef and #endif in C program,
Pascal J. Bourguignon <=
- Re: What is the best way to navigate #ifdef and #endif in C program, Peter Keller, 2010/12/09
- Re: What is the best way to navigate #ifdef and #endif in C program, Alessio Stalla, 2010/12/09
- Re: What is the best way to navigate #ifdef and #endif in C program, Pascal J. Bourguignon, 2010/12/08
Re: What is the best way to navigate #ifdef and #endif in C program, Elena, 2010/12/08
Re: What is the best way to navigate #ifdef and #endif in C program, Elena, 2010/12/08
Re: [OT] Re: What is the best way to navigate #ifdef and #endif in C program, Aaron W . Hsu, 2010/12/09
Re: What is the best way to navigate #ifdef and #endif in C program, Emmy Noether, 2010/12/09
Re: What is the best way to navigate #ifdef and #endif in C program, Johan Bockgård, 2010/12/08
Re: What is the best way to navigate #ifdef and #endif in C program, Alan Mackenzie, 2010/12/08
Re: What is the best way to navigate #ifdef and #endif in C program, patata, 2010/12/09