Re: [fpc-pascal] inline function vs recursive function

2012-02-07 Thread Guionardo Furlan
Inline: http://www.freepascal.org/docs-html/ref/refsu64.html Recursion: http://wiki.freepascal.org/Recursion 2012/2/7 ik : > On Mon, Feb 6, 2012 at 21:58, Sven Barth > wrote: >> >> On 06.02.2012 19:51, ik wrote: >>> >>> Hello, >>> >>> Let's say I have a function that some of it's code (or all) ca

Re: [fpc-pascal] inline function vs recursive function

2012-02-07 Thread ik
On Mon, Feb 6, 2012 at 21:58, Sven Barth wrote: > On 06.02.2012 19:51, ik wrote: > >> Hello, >> >> Let's say I have a function that some of it's code (or all) can be used >> in more then one location inside the function itself. >> I can make a nested function with the code and set it to inline, ma

Re: [fpc-pascal] inline function vs recursive function

2012-02-06 Thread Sven Barth
On 06.02.2012 19:51, ik wrote: Hello, Let's say I have a function that some of it's code (or all) can be used in more then one location inside the function itself. I can make a nested function with the code and set it to inline, make it normal, or make a recursion with it. What's the best pract

Re: [fpc-pascal] inline function vs recursive function

2012-02-06 Thread Everton Vieira
You can make a function inside the function. Like this: function Test: Integer; var i: Integer procedure IncI(aIncI: Integer); begin i := i +aIncI; end; begin i := 1; while i <= 100 do IncI(i); Result := i; end; This make an geometric progression in i. Em 06/02/2012,