File: i86.red

package info (click to toggle)
mathpiper 0.81f%2Bsvn4469%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 36,572 kB
  • sloc: java: 57,479; lisp: 13,721; objc: 1,300; xml: 988; makefile: 114; awk: 95; sh: 38
file content (32 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

lisp;
on comp;

in "i86comp.red"$

on backtrace;

!*genlisting := t;

symbolic procedure foo x; if x then 'one else 'two;

i86!-compile '(de foo (x) (if x 'one 'two));

symbolic procedure fact n;
  if n = 0 then 1 else n * fact sub1 n;

i86!-compile '(de fact (n) (if (equal n 0) 1 (times n (fact (sub1 n)))));

symbol!-env 'fact;

fact 0;
fact 1;
fact 2;
fact 5;
fact 10;

preserve();

end;