File: newlisp-man.txt

package info (click to toggle)
newlisp 10.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 6,248 kB
  • sloc: ansic: 33,280; lisp: 4,181; sh: 609; makefile: 215
file content (172 lines) | stat: -rw-r--r-- 6,694 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
newlisp(1)                  Commandline Parameters                  newlisp(1)



NAME
       newlisp - lisp like programming language

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

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

OPTIONS
       -n     Suppress loading of any  init.lsp  or  .init.lsp  initialization
              file.

       -x source target
              Link  the  newLISP  executable with a source file to built a new
              target executable.

       -h     Display a short help text.

       -v     Display a version string.

       -c     Suppress the commandline prompt.

       -C     Force prompt when running newLISP in pipe I/O mode for Emacs.

       -http  only accept HTTP commands

       -s stacksize
              Stack size to use when starting newLISP. When no stack  size  is
              specified the stack defaults to 1024.

       -m max-mem-megabyte
              Limits  memory  to max-cell-mem-megabyte megabytes for Lisp cell
              memory.

       lisp-files
              Load and evaluate the specified lisp source files  in  sequence.
              Source  files  can be specified using URLs. If an (exit) is exe-
              cuted by one of the source files then newlisp exits and all pro-
              cessing ceases.

       -e programtext
              Programtext  is  an expression enclosed in quotation marks which
              is evaluated and the result printed to standard out device (STD-
              OUT). In most UNIX system shells apostrophes can also be used to
              delimit the expression. newLISP exits after evaluation  of  pro-
              gramtext is complete.

       -w directory
              Directory is the start up directory for newLISP. Any file refer-
              ence in a program will refer to this directory by default as the
              current  directory. This can be used to define a web root direc-
              tory when in server mode.

       -l -L path-file
              Log  network  connections  and  newLISP  I/O  to  the  file   in
              path-file.  -l  will only log network connections or commandline
              input or  net-eval  requests.  -L  will  additionally  log  HTTP
              requests and newLISP output from commandline and net-eval input.

       -p port-number
              Listen for commands on a TCP/IP socket connection. In this  case
              standard  I/O  is  redirected  to  the  port specified in the -p
              option. Any specified lisp-files will be loaded the first time a
              connection  is  made,  that is, before text is accepted from the
              port connection.

       -d port-number
              Run in demon mode. As for the -p option, but  newLISP  does  not
              exit after a closed connection and stays in memory listening for
              a new connection.

       -t microseconds-connection-timeout
              Specifies a connection timeout when running in -p  or  -d  demon
              mode. Server will disconnect when no further input is read after
              accepting a client connection.

       -6     Starts newLISP in IPv6 'Internet Protocol version 6' mode. With-
              out  this  switch newLISP willl start in IPv4 mode. The protocol
              mode can also be switched with the built-in  'net-ipv'  function
              during runtime.

EXAMPLES
       Start interactive session
              newlisp


       Excute a program
              newlisp myprog.lsp


       Excute a remote program
              newlisp http://newlisp.org/example.lsp


       Add 3 and 4, 7 prints on standard output
              newlisp -e "(+ 3 4)"


       newLISP  is  started  as  a server (the & indicates to LINUX to run the
       process in the background) and can be connected to with telnet by issu-
       ing telnet localhost 1234
              newlisp -p 1234 &


       newLISP  is  started as a server for another newlisp process connecting
       with the net-eval function or HTTP requests. Connection  timeout  is  3
       seconds.
              newlisp -c -t 3000000 -d 4711 &


       newLISP is started as a server handling HTTP requests only. Connections
       are logged to the file /usr/home/www/log.txt
              newlisp -l /usr/home/www/log.txt -http -d 8080 &


       newLISP  is started as a server handling HTTP requests and defining the
       startup/web root directory
              newlisp -http -d 8080 -w /usr/home/www/httpdocs &

       When  accepting  HTTP  commands  a file httpd.conf can be loaded, which
       will preprocess the path-name in the HTTP request
              newlisp httpd.conf -http -d 8080 -w /usr/home/www/httpdocs &

       If the file httpd.conf contains:

       (command-event (fn (s)
           (local (request)
               (if (find "?" s) ; is this a query
                   (begin
                       (set 'request (first (parse s "?")))
                       ; discover illegal extension in queries
                       (if (ends-with request ".exe")
                           (set 'request "GET /errorpage.html")
                           (set 'request s)))
                   (set 'request s))
               request) ))

       then  all  files  ending  in  .exe  will  translate the request in to a
       request for  an  error  page,  else  the  original  request  string  is
       returned.


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

AUTHOR
       Lutz Mueller <lutz@nuevatec.com>

       http://www.newlisp.org/ - the newLISP home page



version 10.6.0                    April 2014                        newlisp(1)