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

Re: My First Computer



On Tue, 11 Feb 2003 06:49:09 GMT, "Kelly Hall" <hall@priest.com>
wrote:

>
>"Cameron Kaiser" <ckaiser@floodgap.com> wrote in message
>news:3e487c50$0$171$45beb828@newscene.com...
>> >TO HELLO
>> >PRINT [Hello]
>> >HELLO
>> >END
>>
>> I should think you'll exhaust your stack in no time with that kind of
>> recursion.
>
>Since there's no work to do after the recursive call, the compiler should be
>smart enough to implement the ("tail recursive") call as a jump.  Most
>Lisp/Scheme compilers have been that smart for decades.  GCC handles it if
>you specify -O4.  Since Logo was designed by one of the big names in Scheme,
>I would hope that most Logo environments are smart enough.
>
>Kelly
>
Yes, that's right! Even the very first microcomputer Logo (TI Logo)
implemented tail recursion correctly, although no optimization was
performed - ANY statement following the call would result in the
procedure ending with an 'out of memory' condition.