So i'm reading the SCIP book which uses the Lisp language to explain the core concepts and i'm currently stuck on Linear recursive vs Linear iterative process difference.
and the example used to demonstrate the difference is the computing of n!
Linear recursive process
(if (= n 1) 1 (* n (factorial (- n 1))))) it produces this process :
(* 6 (factorial 5)) (* 6 ( * 5 (factorial 4))) (* 6 ( * 5 ( * 4 ( factorial 3)))) (* 6 ( * 5 ( * 4 ( * 3 ( factorial 2))))) (* 6 ( * 5 ( * 4 ( * 3 (*2 (factorial1)))))) (* 6 ( * 5 ( * 4 ( * 3 (*2 1))))) (* 6 ( * 5 ( * 4 ( * 3 2)))) (* 6 ( * 5 ( * 4 6))) (* 6 ( * 5 24)) (* 6 120) 720 Linear iterative process
(define (factorial n) (if (= n 1) 1 (* n (factorial (- n 1))))) produces the following process
(Factorial 6) (Fact-tier 1 1 6) (Fact-tier 1 2 6) (Fact-tier 2 3 6) (Fact-tier 6 4 6) (Fact-tier 24 5 6) (Fact-tier 120 5 6) (Fact-tier 720 6 6) 720 Even though i did understand the main difference between them i still don't get this paragraph
"The contrast between the two processes can be seen in another way. In the iterative case, the program variables provide a complete description of the state of the process at any point. If we stopped the computation between steps, all we would need to do to resume the computation is to supply the interpreter with the values of the three program variables. Not so with the recursive process. In this case there is some additional "hidden" information, maintained by the interpreter and not contained in the program variables, which indicates ``where the process is'' in negotiating the chain of deferred operations. The longer the chain, the more information must be maintained.