commit 752ad94c7ff341664847a55cfab251802300b8a3
parent 9c9704beef8072d79d520686dcf11a5567a48f70
Author: Alexander Burger <abu@software-lab.de>
Date: Tue, 10 May 2011 09:21:54 +0200
Global vs. local invocation
Diffstat:
2 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/doc/app.html b/doc/app.html
@@ -326,7 +326,7 @@ the server process (you must have generated a <a href="#pw">".pw" file</a> for
this), and enter the <code>html</code> statement
<pre><code>
-$ bin/psh 8080
+$ /usr/share/picolisp/bin/psh 8080
: (html 0 "Hello" "@lib.css" NIL "Hello World!")
HTTP/1.0 200 OK
Server: PicoLisp
@@ -456,7 +456,7 @@ application server is running, and you did generate a <a href="#pw">".pw"
file</a>)
<pre><code>
-$ bin/psh 8080
+$ /usr/share/picolisp/bin/psh 8080
:
</code></pre>
@@ -1089,8 +1089,8 @@ so far, we want to build a simple bignum calculator. ("bignum" because PicoLisp
can do <i>only</i> bignums)
<p>It uses a single form, a single numeric input field, and lots of buttons. It
-can be found in the PicoLisp distribution in "misc/calc.l", together with a
-directly executable wrapper script "misc/calc".
+can be found in the PicoLisp distribution (e.g. under "/usr/share/picolisp/") in
+"misc/calc.l", together with a directly executable wrapper script "misc/calc".
<p>To use it, change to the PicoLisp installation directory, and start it as
@@ -1098,10 +1098,11 @@ directly executable wrapper script "misc/calc".
$ misc/calc
</code></pre>
-<p>If you want to use it from other directories too, change the two relative
-path names in the first line to absolute paths. We recommend symbolic links in
-some global directories, as described in the <a
-href="tut.html#script">Scripting</a> section of the PicoLisp Tutorial.
+<p>or call it with an absolute path, e.g.
+
+<pre><code>
+$ /usr/share/picolisp/misc/calc
+</code></pre>
<p>If you like to get a PicoLisp prompt for inspection, start it instead as
@@ -2178,6 +2179,15 @@ with a some initial data and two sample reports.
<p><hr>
<h3><a name="getStarted">Getting Started</a></h3>
+<p>For a global installation (see <a href="ref.html#inst">Installation</a>),
+please create a symbolic link to the place where the program files are
+installed. This is necessary because the application needs read/write access to
+the current working directory (for the database and other runtime data).
+
+<pre><code>
+$ ln -s /usr/share/picolisp/app
+</code></pre>
+
<p>As ever, you may start up the application in debugging mode
<pre><code>
diff --git a/games/README b/games/README
@@ -1,4 +1,4 @@
-12nov09abu
+10may11abu
(c) Software Lab. Alexander Burger
@@ -8,11 +8,14 @@
This directory contains a few simple games. They are neither especially
interesting, nor powerful, but may be useful as programming examples.
+For a global PicoLisp installation (see the INSTALL file), either supply a full
+path to "/usr/share/picolisp/games/<file>.l" instead of just "games/<file>.l" in
+the commands below, or change the working directory to "/usr/share/picolisp/".
'mine' is a simplified version of the minesweeper game. You can start it as:
-$ ./dbg games/mine.l -main -go
+$ pil games/mine.l -main -go +
It will display a 12-by-12 field with 24 (default) hidden mines. You can move
around using the standard 'vi'-keys 'j' (down), 'k' (up), 'l' (right) and 'h'
@@ -38,7 +41,7 @@ their underlying principles and strategies).
Start 'nim' as
-$ ./dbg games/nim.l
+$ pil games/nim.l +
and then find the optimal move path for, let's say, three heaps of four matches
each:
@@ -54,7 +57,7 @@ from heap 3).
To play Tic-Tac-Toe, enter
-$ ./dbg games/ttt.l -main
+$ pil games/ttt.l -main +
A three-by-three board is displayed. Enter your moves with the 'go' function:
@@ -75,7 +78,7 @@ Your positions are marked with 'T', the computer's with '0'.
The 'chess' game is minimalistic (441 lines of code). Nevertheless, it plays
some slow - though correct - chess. Start it as:
-$ ./dbg games/chess.l -main
+$ pil games/chess.l -main +
+---+---+---+---+---+---+---+---+
8 |<R>|<N>|<B>|<Q>|<K>|<B>|<N>|<R>|
+---+---+---+---+---+---+---+---+
@@ -103,10 +106,6 @@ Alternatively, you can also run it through XBoard (in the X Window System):
$ xboard -fcp games/xchess
-This requires the symbolic links in "/usr/lib/" and "/usr/bin/", as recommended
-in INSTALL. If this is not an option, please modify the first line ("#!") of
-"games/xchess".
-
Without XBoard, you may enter your moves with the field names (in lower case)
for the "from" and "to" positions:
@@ -192,7 +191,7 @@ which later can be restored with
There is also a plain 'sudoku' solver:
-$ ./dbg games/sudoku.l
+$ pil games/sudoku.l +
: (main
(quote