Changes between Version 1 and Version 2 of DebugWithOpenmcl


Ignore:
Timestamp:
Oct 29, 2007, 3:52:45 AM (12 years ago)
Author:
bfulgham
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DebugWithOpenmcl

    v1 v2  
    2626
    2727{{{
    28 (defun fact (n)         ; other traditional definition
    29   (declare (NOTINILINE FACT)) ; and the compiler can't ignore NOTINLINE
    30   (if (zerop n) 1 (* n (fact (1- n)))))
     28  ? (defun fact (x acc)
     29       (declare (NOTINILINE FACT)) ; and the compiler can't ignore NOTINLINE
     30       (if (= x 0)
     31            acc
     32            (fact (- x 1) (* x acc))))
     33
     34  FACT
     35
     36  ? (trace fact)
     37  NIL
     38
     39  ? (fact 10 1)
     40  0> Calling (FACT 10 1)
     41   1> Calling (FACT 9 10)
     42    2> Calling (FACT 8 90)
     43     3> Calling (FACT 7 720)
     44      4> Calling (FACT 6 5040)
     45       5> Calling (FACT 5 30240)
     46        6> Calling (FACT 4 151200)
     47         7> Calling (FACT 3 604800)
     48          8> Calling (FACT 2 1814400)
     49           9> Calling (FACT 1 3628800)
     50            10> Calling (FACT 0 3628800)
     51            <10 FACT returned 3628800
     52           <9 FACT returned 3628800
     53          <8 FACT returned 3628800
     54         <7 FACT returned 3628800
     55        <6 FACT returned 3628800
     56       <5 FACT returned 3628800
     57      <4 FACT returned 3628800
     58     <3 FACT returned 3628800
     59    <2 FACT returned 3628800
     60   <1 FACT returned 3628800
     61  <0 FACT returned 3628800
     62  3628800
     63?
    3164}}}
    3265