commit 8642d1cd398ca16af213a00eccddaa34a25d9253
parent 2b75a3189600b0ff0a450c8ceedaf486d5ef1091
Author: Alexander Burger <abu@software-lab.de>
Date: Fri, 9 Nov 2012 15:22:34 +0100
'-server' command line function
Diffstat:
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/CHANGES b/CHANGES
@@ -1,4 +1,5 @@
* DDmmm12 picoLisp-3.1.1
+ -server function
64-bit emulator
'*CPU' global variable (64-bit)
Bug in 'collect' for 'fold'ed keys
diff --git a/doc/app.html b/doc/app.html
@@ -156,7 +156,7 @@ browser to view the effects)
<p>Open a second terminal window, and start a PicoLisp application server
<pre><code>
-$ pil @lib/http.l @lib/xhtml.l @lib/form.l -'server 8080 "project.l"' +
+$ pil @lib/http.l @lib/xhtml.l @lib/form.l --server 8080 project.l +
</code></pre>
<p>No prompt appears. The server just sits, and waits for connections. You can
@@ -776,7 +776,7 @@ your browser and then look at the terminal window where you started the
application server, you'll notice a colon, the PicoLisp prompt
<pre><code>
-$ pil @lib/http.l @lib/xhtml.l @lib/form.l -'server 8080 "project.l"' +
+$ pil @lib/http.l @lib/xhtml.l @lib/form.l --server 8080 project.l +
:
</code></pre>
@@ -804,7 +804,7 @@ no other browser requests arrive within a default timeout period of 5 minutes.
without the '+' flag, and with <code>-wait</code>
<pre><code>
-$ pil @lib/http.l @lib/xhtml.l @lib/form.l -'server 8080 "project.l"' -wait
+$ pil @lib/http.l @lib/xhtml.l @lib/form.l --server 8080 project.l -wait
</code></pre>
<p>In that way, no command line prompt appears when a client connects.
diff --git a/doc/tut.html b/doc/tut.html
@@ -2060,7 +2060,7 @@ minimal example for a plain HTML-GUI in <code><a
href="hello.l">@doc/hello.l</a></code>. Start the application server as:
<pre><code>
-$ pil @lib/http.l -'server 8080 "@doc/hello.l"' -wait
+$ pil @lib/http.l --server 8080 @doc/hello.l -wait
</code></pre>
<p>Now point your browser to the address '<code><a
diff --git a/lib/http.l b/lib/http.l
@@ -1,4 +1,4 @@
-# 24may12abu
+# 09nov12abu
# (c) Software Lab. Alexander Burger
# *Home *Gate *Host *Port *Port1 *Port% *Http1 *Chunked
@@ -77,6 +77,9 @@
(quit) ) )
### HTTP-Server ###
+(de -server ()
+ (server (format (opt)) (opt)) )
+
(de server (P H)
(setq
*Port P