public
Description: Axiom is a free, open source computer algebra system
Homepage: http://axiom.axiom-developer.org
Clone URL: git://github.com/daly/axiom.git
20071013 acr license/license.ralfs license rewrite
20071013 acr src/interp/http.lisp faster page service
20071013 acr src/algebra/axserver.spad faster page service
Tim Daly (author)
Wed Oct 03 16:03:40 -0700 2007
commit  5ac6d6295c7df3ddf5e16d9cd85a116b71254012
tree    cdb933ad106f5048a919999c4c1e7e95608f2808
parent  67f382845225274268f58449e27be5abdf1a4220
...
 
 
 
1
2
3
...
1
2
3
4
5
6
0
@@ -1,3 +1,6 @@
0
+20071013 acr license/license.ralfs license rewrite
0
+20071013 acr src/interp/http.lisp faster page service
0
+20071013 acr src/algebra/axserver.spad faster page service
0
 20071005 tpd src/input/Makefile kamke7.input regression test added
0
 20071005 tpd src/input/kamke7.input ODE regression test added
0
 20071005 tpd src/input/Makefile kamke6.input regression test added
...
13
14
15
16
17
18
 
 
 
19
20
21
...
13
14
15
 
 
 
16
17
18
19
20
21
0
@@ -13,9 +13,9 @@
0
 -- the documentation and/or other materials provided with the
0
 -- distribution.
0
 --
0
--- - Neither the name of Arthur C. Ralfs nor the
0
--- names of its contributors may be used to endorse or promote products
0
--- derived from this software without specific prior written permission.
0
+-- - The name of Arthur C. Ralfs may not be used to endorse or promote
0
+-- products derived from this software without specific prior written
0
+-- permission.
0
 --
0
 --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
0
 --IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
...
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
143
 
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
175
 
176
177
178
 
 
179
180
181
182
183
184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
186
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
...
229
230
231
232
233
234
 
 
 
235
236
237
...
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
143
144
145
 
146
147
 
 
148
149
150
 
151
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
 
185
186
 
 
187
188
189
 
 
 
 
 
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
 
 
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
261
262
...
278
279
280
 
 
 
281
282
283
284
285
286
0
@@ -33,181 +33,230 @@ the browser to the URL.
0
 )abbrev package AXSERV AxiomServer
0
 AxiomServer: public == private where
0
 
0
- public == with
0
+ public == with
0
 
0
- axServer: (Integer, SExpression->Void) -> Void
0
- multiServ: SExpression -> Void
0
- fileserver: SExpression -> Void
0
- axget: SExpression -> Void
0
- axpost: SExpression -> Void
0
+ axServer: (Integer, SExpression->Void) -> Void
0
+ multiServ: SExpression -> Void
0
 
0
+ private == add
0
 
0
- private == add
0
+ getFile: (SExpression,String) -> Void
0
+ getCommand: (SExpression,String) -> Void
0
+ lastStep: () -> String
0
+ lastType: () -> String
0
+ formatMessages: String -> String
0
+ getContentType: String -> String
0
 
0
- getFile: (SExpression,String) -> Void
0
- getCommand: (SExpression,String) -> Void
0
- lastStep: () -> String
0
- lastType: () -> String
0
- formatMessages: String -> String
0
- formatMessages1: String -> String
0
 
0
+ axServer(port:Integer,serverfunc:SExpression->Void):Void ==
0
+ WriteLine("socketServer")$Lisp
0
+ s := SiSock(port,serverfunc)$Lisp
0
+ -- To listen for just one connection and then close the socket
0
+ -- uncomment i := 0.
0
+ i:Integer := 1
0
+ while (i > 0) repeat
0
+ if not null?(SiListen(s)$Lisp)$SExpression then
0
+ w := SiAccept(s)$Lisp
0
+ serverfunc(w)
0
+-- i := 0
0
 
0
- axServer(port:Integer,serverfunc:SExpression->Void):Void ==
0
- WriteLine("socketServer")$Lisp
0
- s := SiSock(port,serverfunc)$Lisp
0
- -- To listen for just one connection and then close the socket
0
- -- uncomment i := 0.
0
- i:Integer := 1
0
- while (i > 0) repeat
0
- if not null?(SiListen(s)$Lisp)$SExpression then
0
- w := SiAccept(s)$Lisp
0
- serverfunc(w)
0
--- i := 0
0
+ multiServ(s:SExpression):Void ==
0
+ WriteLine("multiServ begin")$Lisp
0
+ headers:String := ""
0
+ char:String
0
+ -- read in the http headers
0
+ while (_
0
+ char := STRING(READ_-CHAR_-NO_-HANG(s,NIL$Lisp,'EOF)$Lisp)$Lisp)_
0
+ ^= "EOF" repeat
0
+ headers := concat [headers,char]
0
+ WriteLine(headers)$Lisp
0
+ StringMatch("([^ ]*)", headers)$Lisp
0
+ u:UniversalSegment(Integer)
0
+ u := segment(MatchBeginning(1)$Lisp+1,_
0
+ MatchEnd(1)$Lisp)$UniversalSegment(Integer)
0
+ reqtype:String := headers.u
0
+ WriteLine$Lisp concat ["request type: ",reqtype]
0
+ if reqtype = "GET" then
0
+ StringMatch("GET ([^ ]*)",headers)$Lisp
0
+ u:UniversalSegment(Integer)
0
+ u := segment(MatchBeginning(1)$Lisp+1,_
0
+ MatchEnd(1)$Lisp)$UniversalSegment(Integer)
0
+ getFile(s,headers.u)
0
+ if reqtype = "POST" then
0
+ StringMatch("command=(.*)$",headers)$Lisp
0
+ u:UniversalSegment(Integer)
0
+ u := segment(MatchBeginning(1)$Lisp+1,_
0
+ MatchEnd(1)$Lisp)$UniversalSegment(Integer)
0
+ getCommand(s,headers.u)
0
+ WriteLine("multiServ end")$Lisp
0
+ WriteLine("")$Lisp
0
 
0
- multiServ(s:SExpression):Void ==
0
- WriteLine("multiServ")$Lisp
0
- headers:String := ""
0
- char:String
0
- -- read in the http headers
0
- while (char := _
0
- STRING(READ_-CHAR_-NO_-HANG(s,NIL$Lisp,'EOF)$Lisp)$Lisp) ^= "EOF"_
0
- repeat
0
- headers := concat [headers,char]
0
- sayTeX$Lisp headers
0
- StringMatch("([^ ]*)", headers)$Lisp
0
- u:UniversalSegment(Integer)
0
- u := segment(MatchBeginning(1)$Lisp+1,_
0
- MatchEnd(1)$Lisp)$UniversalSegment(Integer)
0
- reqtype:String := headers.u
0
- sayTeX$Lisp concat ["request type: ",reqtype]
0
- if reqtype = "GET" then
0
- StringMatch("GET ([^ ]*)",headers)$Lisp
0
- u:UniversalSegment(Integer)
0
- u := segment(MatchBeginning(1)$Lisp+1,_
0
- MatchEnd(1)$Lisp)$UniversalSegment(Integer)
0
- getFile(s,headers.u)
0
- if reqtype = "POST" then
0
- StringMatch("command=(.*)$",headers)$Lisp
0
- u:UniversalSegment(Integer)
0
- u := segment(MatchBeginning(1)$Lisp+1,_
0
- MatchEnd(1)$Lisp)$UniversalSegment(Integer)
0
- getCommand(s,headers.u)
0
+ getFile(s:SExpression,pathvar:String):Void ==
0
+ WriteLine("")$Lisp
0
+ WriteLine("getFile begin")$Lisp
0
+ if not null? PATHNAME_-NAME(PATHNAME(pathvar)$Lisp)$Lisp then
0
+ contentType:String := "application/xhtml+xml"
0
+ q := Open(pathvar)$Lisp
0
+ if null? q then
0
+ q := MAKE_-STRING_-INPUT_-STREAM("File doesn't exist")$Lisp
0
+ WriteLine("File does not exist.")$Lisp
0
+ else
0
+ q:=MAKE_-STRING_-INPUT_-STREAM("Problem with file path")$Lisp
0
+ file:String := ""
0
+ WriteLine("begin reading file")$Lisp
0
+ r := MAKE_-STRING_-OUTPUT_-STREAM()$Lisp
0
+ SiCopyStream(q,r)$Lisp
0
+ filestream:String := GET_-OUTPUT_-STREAM_-STRING(r)$Lisp
0
+ CLOSE(r)$Lisp
0
+ CLOSE(q)$Lisp
0
+ filelength:String := string(#filestream)
0
+ WriteLine("end reading file")$Lisp
0
+ file := concat ["Content-Length: ",filelength,_
0
+ STRING(NewLine$Lisp)$Lisp,STRING(NewLine$Lisp)$Lisp,file]
0
+ file := concat ["Connection: close",STRING(NewLine$Lisp)$Lisp,file]
0
+ file := concat ["Content-Type: ",contentType,_
0
+ STRING(NewLine$Lisp)$Lisp,file]
0
+ file := concat ["HTTP/1.1 200 OK",STRING(NewLine$Lisp)$Lisp,file]
0
+ file := concat [file,filestream]
0
+ f:=MAKE_-STRING_-INPUT_-STREAM(file)$Lisp
0
+ SiCopyStream(f,s)$Lisp
0
+ CLOSE(f)$Lisp
0
+ CLOSE(s)$Lisp
0
+ WriteLine("getFile end")$Lisp
0
+ WriteLine("")$Lisp
0
 
0
- getFile(s:SExpression,pathvar:String):Void ==
0
- WriteLine("getFile")$Lisp
0
- if not null? PATHNAME_-NAME(PATHNAME(pathvar)$Lisp)$Lisp then
0
- -- display contents of file
0
- q:=OPEN(pathvar)$Lisp
0
- else
0
- q:=MAKE_-STRING_-INPUT_-STREAM("Problem with file path")$Lisp
0
- file:String := ""
0
- while (line :=STRING(READ_-LINE(q,NIL$Lisp,'EOF)$Lisp)$Lisp) ^= "EOF" _
0
- repeat
0
- file := concat [file,line,STRING(NewLine$Lisp)$Lisp]
0
- CLOSE(q)$Lisp
0
- file := concat _
0
- ["Content-Length: ",string(#file),STRING(NewLine$Lisp)$Lisp,_
0
- STRING(NewLine$Lisp)$Lisp,file]
0
- file := concat ["Connection: close",STRING(NewLine$Lisp)$Lisp,file]
0
- file := concat _
0
- ["Content-Type: application/xhtml+xml",STRING(NewLine$Lisp)$Lisp,file]
0
- file := concat ["HTTP/1.1 200 OK",STRING(NewLine$Lisp)$Lisp,file]
0
- f:=MAKE_-STRING_-INPUT_-STREAM(file)$Lisp
0
- SiCopyStream(f,s)$Lisp
0
- CLOSE(f)$Lisp
0
- CLOSE(s)$Lisp
0
-
0
- getCommand(s:SExpression,command:String):Void ==
0
- WriteLine$Lisp concat ["getCommand: ",command]
0
- SETQ(tmpmathml$Lisp, MAKE_-STRING_-OUTPUT_-STREAM()$Lisp)$Lisp
0
- SETQ(tmpalgebra$Lisp, MAKE_-STRING_-OUTPUT_-STREAM()$Lisp)$Lisp
0
- SETQ(savemathml$Lisp, _$texOutputStream$Lisp)$Lisp
0
- SETQ(savealgebra$Lisp, _$algebraOutputStream$Lisp)$Lisp
0
- SETQ(_$texOutputStream$Lisp,tmpmathml$Lisp)$Lisp
0
- SETQ(_$algebraOutputStream$Lisp,tmpalgebra$Lisp)$Lisp
0
+ getCommand(s:SExpression,command:String):Void ==
0
+ WriteLine$Lisp concat ["getCommand: ",command]
0
+ SETQ(tmpmathml$Lisp, MAKE_-STRING_-OUTPUT_-STREAM()$Lisp)$Lisp
0
+ SETQ(tmpalgebra$Lisp, MAKE_-STRING_-OUTPUT_-STREAM()$Lisp)$Lisp
0
+ SETQ(savemathml$Lisp, _$texOutputStream$Lisp)$Lisp
0
+ SETQ(savealgebra$Lisp, _$algebraOutputStream$Lisp)$Lisp
0
+ SETQ(_$texOutputStream$Lisp,tmpmathml$Lisp)$Lisp
0
+ SETQ(_$algebraOutputStream$Lisp,tmpalgebra$Lisp)$Lisp
0
 -- parseAndInterpret$Lisp command
0
 -- parseAndEvalStr$Lisp command
0
 -- The previous two commands don't exit nicely when a syntactically
0
--- incorrect command is given to them. They somehow need to be wrapped
0
+-- incorrect command is given to them. They somehow need to be wrapped
0
 -- in CATCH statements but I haven't figured out how to do this.
0
--- parseAndEvalToStringEqNum uses the following CATCH statements to
0
--- call parseAndEvalStr but when I try these they don't work. I get a
0
--- "NIL is not a valid identifier to use in AXIOM" message.
0
--- Using parseAndEvalToStringEqNum works and doesn't crash on a syntax error.
0
+-- parseAndEvalToStringEqNum uses the following CATCH statements to call
0
+-- parseAndEvalStr but when I try these they don't work. I get a
0
+-- "NIL is not a valid identifier to use in AXIOM" message. Using
0
+-- parseAndEvalToStringEqNum works and doesn't crash on a syntax error.
0
 -- v := CATCH('SPAD__READER, _
0
- CATCH('top__level, parseAndEvalStr$Lisp command)$Lisp)$Lisp
0
+-- CATCH('top__level, parseAndEvalStr$Lisp command)$Lisp)$Lisp
0
 -- v = 'restart => ['"error"]
0
- ans := string parseAndEvalToStringEqNum$Lisp command
0
- SETQ(resultmathml$Lisp,_
0
+ ans := string parseAndEvalToStringEqNum$Lisp command
0
+ SETQ(resultmathml$Lisp,_
0
          GET_-OUTPUT_-STREAM_-STRING(_$texOutputStream$Lisp)$Lisp)$Lisp
0
- SETQ(resultalgebra$Lisp,_
0
+ SETQ(resultalgebra$Lisp,_
0
          GET_-OUTPUT_-STREAM_-STRING(_$algebraOutputStream$Lisp)$Lisp)$Lisp
0
- SETQ(_$texOutputStream$Lisp,savemathml$Lisp)$Lisp
0
- SETQ(_$algebraOutputStream$Lisp,savealgebra$Lisp)$Lisp
0
- CLOSE(tmpmathml$Lisp)$Lisp
0
- CLOSE(tmpalgebra$Lisp)$Lisp
0
- -- Since strings returned from axiom are going to be displayed in html
0
- -- I should really check for the characters &,<,> and replace them with
0
- -- &amp;,&lt;,&gt;.
0
- -- At present I only check for ampersands in formatMessages.
0
- mathml:String := string(resultmathml$Lisp)
0
- algebra:String := string(resultalgebra$Lisp)
0
- algebra := formatMessages(algebra)
0
- -- At this point mathml contains the mathml for the output but does
0
- -- not include step number or type information. We should also save
0
- -- the command. I get the type and step number from the
0
- -- $internalHistoryTable
0
- axans:String := concat
0
- ["<div>"_
0
- "<div class=_"stepnum_"> (", lastStep(), _
0
- ") -&gt; ", command, "</div>" _
0
- "<div class=_"algebra_">", algebra, "</div>" _
0
- "<div id=_"answer_" class=_"mathml_">", mathml , "</div>" _
0
- "<div class=_"type_">Type: ",lastType(),"</div>"_
0
- "</div>"]
0
- WriteLine$Lisp concat ["mathml answer: ",mathml]
0
- WriteLine$Lisp concat ["algebra answer: ",algebra]
0
- q:=MAKE_-STRING_-INPUT_-STREAM(axans)$Lisp
0
- SiCopyStream(q,s)$Lisp
0
- CLOSE(q)$Lisp
0
- CLOSE(s)$Lisp
0
+ SETQ(_$texOutputStream$Lisp,savemathml$Lisp)$Lisp
0
+ SETQ(_$algebraOutputStream$Lisp,savealgebra$Lisp)$Lisp
0
+ CLOSE(tmpmathml$Lisp)$Lisp
0
+ CLOSE(tmpalgebra$Lisp)$Lisp
0
+ -- Since strings returned from axiom are going to be
0
+ -- displayed in html I
0
+ -- should really check for the characters &,<,> and
0
+ -- replace them with
0
+ -- &amp;,&lt;,&gt;. At present I only check for ampersands in
0
+ -- formatMessages. MathML should already be valid xml.
0
+ mathml:String := string(resultmathml$Lisp)
0
+ algebra:String := string(resultalgebra$Lisp)
0
+ algebra := formatMessages(algebra)
0
+ -- At this point mathml contains the mathml for the
0
+ -- output but does not
0
+ -- include step number or type information.
0
+ -- We should also save the command.
0
+ -- I get the type and step number from the $internalHistoryTable
0
+ axans:String := concat _
0
+ ["<div><div class=_"command_">(",lastStep(),") -> ",_
0
+ command,"</div><div class=_"algebra_">",_
0
+ algebra,"</div><div class=_"mathml_">",_
0
+ mathml,"</div><div class=_"type_">Type: ",_
0
+ lastType(),"</div></div>"]
0
+ WriteLine$Lisp concat ["mathml answer: ",mathml]
0
+ WriteLine$Lisp concat ["algebra answer: ",algebra]
0
+ q:=MAKE_-STRING_-INPUT_-STREAM(axans)$Lisp
0
+ SiCopyStream(q,s)$Lisp
0
+ CLOSE(q)$Lisp
0
+ CLOSE(s)$Lisp
0
+
0
 
0
- lastType():String ==
0
+ lastType():String ==
0
 -- The last history entry is the first item in the
0
--- $internalHistoryTable list so car(_$internalHistoryTable$Lisp)
0
--- selects it. Here's an example:
0
+-- $internalHistoryTable list so
0
+-- car(_$internalHistoryTable$Lisp) selects it. Here's an example:
0
 -- (3 (x+y)**3 (% (value (Polynomial (Integer)) WRAPPED 1 y
0
--- (3 0 . 1) (2 1 x (1 0 . 3)) (1 1 x (2 0 . 3)) (0 1 x (3 0 . 1)))))
0
--- This corresponds to the input "(x+y)**3" being issued as the third
0
--- command after starting axiom.
0
--- The following line selects the type information.
0
- string cadr(cadar(cddar(_$internalHistoryTable$Lisp)$Lisp)$Lisp)$Lisp
0
+-- (3 0 . 1) (2 1 x (1 0 . 3)) (1 1 x (2 0 . 3)) (0 1 x (3 0 . 1)))))
0
+-- This corresponds to the input "(x+y)**3" being issued
0
+-- as the third command after
0
+-- starting axiom. The following line selects the type information.
0
+ string cadr(cadar(cddar(_$internalHistoryTable$Lisp)$Lisp)$Lisp)$Lisp
0
+
0
+
0
+ lastStep():String ==
0
+ string car(car(_$internalHistoryTable$Lisp)$Lisp)$Lisp
0
+
0
+
0
+ formatMessages(str:String):String ==
0
+ WriteLine("formatMessages")$Lisp
0
+ -- I need to replace any ampersands with &amp; and may also need to
0
+ -- replace < and > with &lt; and &gt;
0
+ strlist:List String
0
+ WriteLine(str)$Lisp
0
+ strlist := split(str,char "&")
0
+ str := ""
0
+ -- oops, if & is the last character in the string this method
0
+ -- will eliminate it. Need to redo this.
0
+ for s in strlist repeat
0
+ str := concat [str,s,"&amp;"]
0
+ strlen:Integer := #str
0
+ str := str.(1..(#str - 5))
0
+ WriteLine(str)$Lisp
0
+ -- Here I split the string into lines and put each line in a "div".
0
+ strlist := split(str, char string NewlineChar$Lisp)
0
+ str := ""
0
+ WriteLine("formatMessages1")$Lisp
0
+ WriteLine(concat strlist)$Lisp
0
+ for s in strlist repeat
0
+ WriteLine(s)$Lisp
0
+ str := concat [str,"<div>",s,"</div>"]
0
+ str
0
 
0
- lastStep():String ==
0
- string caar(_$internalHistoryTable$Lisp)$Lisp
0
+ getContentType(pathvar:String):String ==
0
+ WriteLine("getContentType begin")$Lisp
0
+ -- set default content type
0
+ contentType:String := "text/plain"
0
+ -- need to test for successful match?
0
+ StringMatch(".*\.(.*)$", pathvar)$Lisp
0
+ u:UniversalSegment(Integer)
0
+ u := segment(MatchBeginning(1)$Lisp+1,_
0
+ MatchEnd(1)$Lisp)$UniversalSegment(Integer)
0
+ extension:String := pathvar.u
0
+ WriteLine$Lisp concat ["file extension: ",extension]
0
+ -- test for extensions: html, htm, xml, xhtml, js, css, png, jpg, jpeg
0
+ if extension = "html" then
0
+ contentType:String := "text/html"
0
+ else if extension = "htm" then
0
+ contentType:String := "text/html"
0
+ else if extension = "xml" then
0
+ contentType:String := "text/xml"
0
+ else if extension = "xhtml" then
0
+ contentType:String := "application/xhtml+xml"
0
+ else if extension = "js" then
0
+ contentType:String := "text/javascript"
0
+ else if extension = "css" then
0
+ contentType:String := "text/css"
0
+ else if extension = "png" then
0
+ contentType:String := "image/png"
0
+ else if extension = "jpg" then
0
+ contentType:String := "image/jpeg"
0
+ else if extension = "jpeg" then
0
+ contentType:String := "image/jpeg"
0
+ WriteLine$Lisp concat ["Content-Type: ",contentType]
0
+ WriteLine("getContentType end")$Lisp
0
+ contentType
0
 
0
- formatMessages(str:String):String ==
0
- WriteLine("formatMessages")$Lisp
0
- -- I need to replace any ampersands with &amp; and may also need to
0
- -- replace < and > with &lt; and &gt;
0
- strlist:List String
0
- WriteLine(str)$Lisp
0
- strlist := split(str,char "&")
0
- str := ""
0
- for s in strlist repeat
0
- str := concat [str,s,"&amp;"]
0
- strlen:Integer := #str
0
- str := str.(1..(#str - 5))
0
- WriteLine(str)$Lisp
0
- -- Here I split the string into lines and put each line in a "div".
0
- strlist := split(str, char string NewlineChar$Lisp)
0
- str := ""
0
- WriteLine("formatMessages1")$Lisp
0
- WriteLine(concat strlist)$Lisp
0
- for s in strlist repeat
0
- WriteLine(s)$Lisp
0
- str := concat [str,"<div>",s,"</div>"]
0
- str
0
 
0
 
0
 @
0
@@ -229,9 +278,9 @@ AxiomServer: public == private where
0
 -- the documentation and/or other materials provided with the
0
 -- distribution.
0
 --
0
--- - Neither the name of Arthur C. Ralfs nor the
0
--- names of its contributors may be used to endorse or promote products
0
--- derived from this software without specific prior written permission.
0
+-- - The name of Arthur C. Ralfs may not be used to endorse or promote
0
+-- products derived from this software without specific prior written
0
+-- permission.
0
 --
0
 --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
0
 --IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
...
1
2
3
 
 
 
 
4
5
6
...
1
2
 
3
4
5
6
7
8
9
0
@@ -1,6 +1,9 @@
0
 (in-package "BOOT")
0
 
0
-(defvar |StandardOutput| *standard-output*)
0
+(defun |Open| (path)
0
+ (si::open path :direction :input :if-exists nil :if-does-not-exist nil)
0
+ )
0
+
0
 
0
 (defvar |NewLine| '#\NewLine)
0
 

Comments

    No one has commented yet.