1newlisp(1)                  Commandline Parameters                  newlisp(1)
2
3
4

NAME

6       newlisp - lisp like programming language
7

SYNOPSIS

9       newlisp  [-n]  [-x  source  target]  [-h  |  -v]  [-c | -C | -http] [-t
10       microseconds] [-s stack] [-m  max-mem-megabyte]  [[-l  path-file  |  -L
11       path-file]   [-p   port-number   |   -d  port-number]]  [-w  directory]
12       [lisp-files ...] [-e programtext]
13

DESCRIPTION

15       Invokes newLISP which first loads init.lsp if present. Then one or more
16       options  and  one  or  more  newLISP source files can be specified. The
17       options and source files are executed in the sequence they appear.  For
18       some  options is makes sense to have source files loaded first like for
19       the -p and -d options. For other options like -s and -m it  is  logical
20       to  specify  these before the source files to be loaded. If a -e switch
21       is used the programtext is evaluated and then newlisp  exits  otherwise
22       evaluation  continues  interactively  (unless  an  exit  occurs  during
23       lisp-file interpretation).
24

OPTIONS

26       -n     Suppress loading of any  init.lsp  or  .init.lsp  initialization
27              file.
28
29       -x source target
30              Link  the  newLISP  executable with a source file to built a new
31              target executable.
32
33       -h     Display a short help text.
34
35       -v     Display a version string.
36
37       -c     Suppress the commandline prompt.
38
39       -C     Force prompt when running newLISP in pipe I/O mode for Emacs.
40
41       -http  only accept HTTP commands
42
43       -s stacksize
44              Stack size to use when starting newLISP. When no stack  size  is
45              specified the stack defaults to 1024.
46
47       -m max-mem-megabyte
48              Limits  memory  to max-cell-mem-megabyte megabytes for Lisp cell
49              memory.
50
51       lisp-files
52              Load and evaluate the specified lisp source files  in  sequence.
53              Source  files  can be specified using URLs. If an (exit) is exe‐
54              cuted by one of the source files then newlisp exits and all pro‐
55              cessing ceases.
56
57       -e programtext
58              Programtext  is  an expression enclosed in quotation marks which
59              is evaluated and the result printed to standard out device (STD‐
60              OUT). In most UNIX system shells apostrophes can also be used to
61              delimit the expression. newLISP exits after evaluation  of  pro‐
62              gramtext is complete.
63
64       -w directory
65              Directory is the start up directory for newLISP. Any file refer‐
66              ence in a program will refer to this directory by default as the
67              current  directory. This can be used to define a web root direc‐
68              tory when in server mode.
69
70       -l -L path-file
71              Log  network  connections  and  newLISP  I/O  to  the  file   in
72              path-file.  -l  will only log network connections or commandline
73              input or  net-eval  requests.  -L  will  additionally  log  HTTP
74              requests and newLISP output from commandline and net-eval input.
75
76       -p port-number
77              Listen  for commands on a TCP/IP socket connection. In this case
78              standard I/O is redirected to  the  port  specified  in  the  -p
79              option. Any specified lisp-files will be loaded the first time a
80              connection is made, that is, before text is  accepted  from  the
81              port connection.
82
83       -d port-number
84              Run  in  demon  mode. As for the -p option, but newLISP does not
85              exit after a closed connection and stays in memory listening for
86              a new connection.
87
88       -t microseconds-connection-timeout
89              Specifies  a  connection  timeout when running in -p or -d demon
90              mode. Server will disconnect when no further input is read after
91              accepting a client connection.
92
93       -6     Starts newLISP in IPv6 'Internet Protocol version 6' mode. With‐
94              out this switch newLISP willl start in IPv4 mode.  The  protocol
95              mode  can  also be switched with the built-in 'net-ipv' function
96              during runtime.
97

EXAMPLES

99       Start interactive session
100              newlisp
101
102       Excute a program
103              newlisp myprog.lsp
104
105       Excute a remote program
106              newlisp http://newlisp.org/example.lsp
107
108       Add 3 and 4, 7 prints on standard output
109              newlisp -e "(+ 3 4)"
110
111       newLISP is started as a server (the & indicates to  LINUX  to  run  the
112       process in the background) and can be connected to with telnet by issu‐
113       ing telnet localhost 1234
114              newlisp -p 1234 &
115
116       newLISP is started as a server for another newlisp  process  connecting
117       with  the  net-eval  function or HTTP requests. Connection timeout is 3
118       seconds.
119              newlisp -c -t 3000000 -d 4711 &
120
121       newLISP is started as a server handling HTTP requests only. Connections
122       are logged to the file /usr/home/www/log.txt
123              newlisp -l /usr/home/www/log.txt -http -d 8080 &
124
125       newLISP  is started as a server handling HTTP requests and defining the
126       startup/web root directory
127              newlisp -http -d 8080 -w /usr/home/www/httpdocs &
128
129       When accepting HTTP commands a file httpd.conf  can  be  loaded,  which
130       will preprocess the path-name in the HTTP request
131              newlisp httpd.conf -http -d 8080 -w /usr/home/www/httpdocs &
132
133       If the file httpd.conf contains:
134
135       (command-event (fn (s)
136           (local (request)
137               (if (find "?" s) ; is this a query
138                   (begin
139                       (set 'request (first (parse s "?")))
140                       ; discover illegal extension in queries
141                       (if (ends-with request ".exe")
142                           (set 'request "GET /errorpage.html")
143                           (set 'request s)))
144                   (set 'request s))
145               request) ))
146
147       then  all  files  ending  in  .exe  will  translate the request in to a
148       request for  an  error  page,  else  the  original  request  string  is
149       returned.
150

EXIT STATUS

152       newLISP  returns  a  zero  exit status for normal termination unless an
153       exit command specifies a code to be returned. Non zero is  returned  in
154       case of abnormal exit.
155

AUTHOR

157       Lutz Mueller <lutz@nuevatec.com>
158
159       http://www.newlisp.org/ - the newLISP home page
160
161
162
163version 10.6.0                    April 2014                        newlisp(1)
Impressum