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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
PACKET lisp (* Autor: J.Durchholz , P. Heyderhoff *)
(* Datum: 09.05.1984 *)
DEFINES (* Version 1.7.2 *)
start lisp system,
lisp heap,
insert lisp,
run lisp,
run lisp again,
lisp:
SYM VAR run again pointer :: nil;
DATASPACE VAR insert heap :: nil space;
PROC start lisp system (DATASPACE CONST heap):
enable stop;
initialize lisp system (heap);
forget (insert heap);
insert heap := heap
END PROC start lisp system;
PROC start lisp system (DATASPACE CONST heap, FILE VAR f):
start lisp system (heap);
input (f);
WHILE NOT eof (f) REP
TEXT VAR name;
get (f, name);
SYM CONST s :: new atom (name);
get (f, name);
SYM CONST property name :: new atom (name);
IF NOT null (property name) THEN
SYM VAR property;
get (f, property);
add property (s, property name, property)
FI;
PER
END PROC start lisp system;
PROC start lisp system (FILE VAR f):
create lisp system (f, insert heap)
END PROC start lisp system;
DATASPACE PROC lisp heap:
insert heap
END PROC lisp heap;
DATASPACE VAR run heap :: nil space;
PROC insert lisp:
insert lisp (last param)
END PROC insert lisp;
PROC insert lisp (TEXT CONST file name):
interpret (insert heap, file name)
END PROC insert lisp;
PROC run lisp:
run lisp (last param)
END PROC run lisp;
PROC run lisp (TEXT CONST file name):
forget (run heap);
run heap := insert heap;
interpret (run heap, file name)
END PROC run lisp;
DATASPACE VAR do heap :: nil space,
do file :: nil space;
PROC interpret (DATASPACE CONST heap, TEXT CONST file name):
enable stop;
FILE VAR f :: sequential file (input, file name);
interpret (heap, f)
END PROC interpret;
PROC interpret (DATASPACE CONST heap, FILE VAR f):
initialize lisp system (heap);
get (f, run again pointer);
add property (new atom ("program"), new atom ("APVAL"), run again pointer);
put (evalquote (run again pointer))
END PROC interpret;
PROC run lisp again:
put (evalquote (run again pointer))
END PROC run lisp again;
PROC get ausdruck:
enable stop; get (ausdruck)
END PROC get ausdruck;
SYM VAR ausdruck;
PROC lisp:
(* HAUPT TESTPROGRAMM FUER LISP Heyderhoff 25.1.83 *)
IF NOT exists ("LISP HEAP") THEN
FILE VAR bootstrap :: sequential file (input, "lisp.bootstrap");
create lisp system (bootstrap, new ("LISP HEAP"));
verbose lisp output (TRUE);
FI;
FILE VAR out :: notefile; output (out);
SYM VAR work;
command dialogue(FALSE); forget ("LISP INPUT"); command dialogue(TRUE);
(* bildlaenge(23); *) (* EUMEL 1.65 *)
disable stop;
REP
get (ausdruck);
IF is error THEN
handle error
ELSE
output (out);
work := evalquote (ausdruck);
IF is error THEN handle error
ELSE put (out, work)
FI
FI
PER .
handle error:
IF text (error message, 18) = "halt from terminal" THEN
enable stop
ELSE
put (out, error message);
put ( error message); pause(20);
clear error;
FI .
END PROC lisp;
END PACKET lisp;
|