title: Linear recursive vs Linear iterative process (LISP)
body: <p>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.</p>
  
  <p>and the example used to demonstrate the difference is the computing of n! </p>
  
  <p><strong>Linear recursive process</strong> </p>
  
  <pre><code> (if (= n 1)
   1
   (* n (factorial (- n 1))))) 
  
  </code></pre>
  
  <p>it produces this process :</p>
  
  <pre><code>
  (* 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
  
  </code></pre>
  
  <p><strong>Linear iterative process</strong> </p>
  
  <pre><code>(define (factorial n)
   (if (= n 1)
   1
   (* n (factorial (- n 1))))) 
  </code></pre>
  
  <p>produces the following process </p>
  
  <pre><code>(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
  </code></pre>
  
  <p>Even though i did understand the main difference between them i still don't get this paragraph</p>
  
  <p>"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.</p>