proper tail calls

Maciej Stachowiak mjs at apple.com
Mon Jan 21 23:37:05 PST 2008


On Jan 21, 2008, at 10:52 PM, Brendan Eich wrote:

> On Jan 21, 2008, at 8:02 PM, Maciej Stachowiak wrote:
>
>> On Jan 21, 2008, at 12:35 PM, Brendan Eich wrote:
>>
>>> Conversions (implicit and hardcoded among the
>>> built-in types representing and wrapping primitives) that might
>>> defeat PTC may not be evident until runtime, where the result would
>>> be a TypeError or possibly a new Error subtype.
>>
>> Isn't this case (implicit conversion) exactly what motivated the idea
>> that programmers may not be able to easily tell if a call is in tail
>> position?
>
>
> Indeed:
>
> "ES4 has proper tail calls, but their constraints are sometimes  
> subtle, especially with regard to conversions or type checks  
> inserted at the return point. It may be that the "Explicit Is Better  
> Than Implicit" principle once again finds application here."
>
> First paragraph in http://bugs.ecmascript.org/ticket/323. Again, the  
> ticket is just sitting there, you don't need me transcribing it into  
> this list :-/.

What I meant to point out is that the motivating use case for  
additional up-front checking can't in general be checked until  
runtime, which somewhat undermines the point you made that many non- 
tail cases could be caught at compile time.

Cheers,
Maciej




More information about the Es4-discuss mailing list