Am 04.09.2010 15:08, schrieb Sven Barth: > On 28.08.2010 11:57, Florian Klämpfl wrote: >> Am 03.09.2010 21:31, schrieb Sven Barth: >>> On 03.09.2010 18:02, Marco van de Voort wrote: >>>> >>>>> Second, does FPC understand "tail recursion"? >>>> >>>> Depends on version, do >>>> >>>> fpc -i |grep -i tailrec >>>> >>>> to find out more. >>> >>> O.o >>> >>> Ok... now I'm officially impressed. >> >> Well, simple to implement and useless optimization :) > > But it's nice to have. > > In the lecture "Introduction of Computer Science 2" we had to learn > functional programming with the programming language OCaml. There we > used tail recursion a lot (and I always tried to write my functions in a > tail recursive form) and it's nice to see/know that FPC can do that as > well. :)
IIRC in the whole FPC source tree are two cases where this optimization is applied :) > > Btw: is this a CPU dependent optimization? > No. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal