To run default standalone interpreter, just type 'VSLisp
':
$ VSLisp
VSLisp, V4.0 (c) by VSL, 1994-2000
Lisp>>
Use command line parameter '-i filename
' to specify script name.
VSLisp executable script may look like this one:
#!/usr/bin/VSLisp -i
(print '"Hello World")
(exit)
You must insert '(exit)
' at the end of any script for
compatibility - VSLisp may start interactive interpreter after loading script.
Command line parameters list is defined in a Lisp symbol *pars*
.
In interactive mode VSLisp standalone interpreter waits for lists to evaluate. Interactive session may look like:
[vsl@ontil vsl]$ VSLisp
VSLisp, V4.0 (c) by VSL, 1994-2000
Lisp>> (defun Fak (x) (if (= x 0) 1 (* x (Fak (- x 1)))))
<< ( lambda ( x) ( if ( = x 0) 1 ( * x ( Fak ( - x 1)))))
Lisp>> (Fak 10)
<< 3.6288e+06
Lisp>> (Fak 5)
<< 120
Lisp>>
NOTE:
Only lists will be evaluated, atoms just ignored.
e.g., you cannot do something like this:
Lisp>> (setq a 100)
<< 100
Lisp>> a