Tomas Hlavaty <> writes:

Hi Tomas,

>> The notion of 'tail-recursion' does not have any meaning in an
>> interpreted language like PicoLisp, since its only for compiler
>> optimizations -right?
> I think you are confusing the terms.  What you are probably after is
> called tail call optimisation (TCO), which is an optimisation that can
> be applied to tail calls.

tail-recursion is definitely one way to name it, there are a lot of
usage examples around, e.g.


but TCO might be a more accurate term, or lets put it like this - many
books about compiled languages state that tail-recusrion is important
because it enables TCO. 

> There are interpreters that require TCO, e.g. PostScript.  In my
> JavaScript implementation of PostScript
> <>, I used trampoline to implement it
> and optimize stack growth.  As
> shown in the examples, one can use the technique in PicoLisp too,
> althought it doesn't compose well.

nice example, thanks for the link!



Reply via email to