i86.red 427 B

123456789101112131415161718192021222324252627282930313233
  1. lisp;
  2. on comp;
  3. in "i86comp.red"$
  4. on backtrace;
  5. !*genlisting := t;
  6. symbolic procedure foo x; if x then 'one else 'two;
  7. i86!-compile '(de foo (x) (if x 'one 'two));
  8. symbolic procedure fact n;
  9. if n = 0 then 1 else n * fact sub1 n;
  10. i86!-compile '(de fact (n) (if (equal n 0) 1 (times n (fact (sub1 n)))));
  11. symbol!-env 'fact;
  12. fact 0;
  13. fact 1;
  14. fact 2;
  15. fact 5;
  16. fact 10;
  17. preserve();
  18. end;