newlisp(1)

πŸ“¦
version 10.7.5 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ newlisp(1) β€” Commandline Parameters πŸŽ€

bestie. okay so this is the manual page for newlisp, the lisp like programming language, and honestly? it's giving iconic. let's get into it πŸ’…


✨ 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 ✨

So when you invoke newLISP, the very first thing it does is load init.lsp if it's there. Then you can throw in one or more options and one or more newLISP source files, and honestly the order you type them in is the order they run. No cap.

For some options it genuinely makes sense to have the source files loaded first β€” think -p and -d. For others, like -s and -m, it's logical to specify those before the source files get loaded. 🧠✨

If you use a -e switch, the programtext gets evaluated and then newlisp exits. Otherwise, evaluation just keeps going interactively β€” unless an exit happens during lisp-file interpretation, obviously. πŸ™ˆ


✨ OPTIONS ✨

  • -n β€” suppresses loading of any init.lsp or .init.lsp initialization file. like, don't even look at it πŸ’€
  • -x source target β€” link the newLISP executable with a source file to built a new target executable. πŸ”—
  • -h β€” display a short help text. the lil "help me" button 🫢
  • -v β€” display a version string. 🌈
  • -c β€” suppress the commandline prompt. shhh, no prompt 🀫
  • -C β€” force prompt when running newLISP in pipe I/O mode for Emacs. yes, force it. periodt.
  • -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 executed by one of the source files then newlisp exits and all processing ceases. πŸšͺ
  • -e programtext β€” programtext is an expression enclosed in quotation marks which is evaluated and the result printed to standard out device (STDOUT). In most UNIX system shells apostrophes can also be used to delimit the expression. newLISP exits after evaluation of programtext is complete. ⭐
  • -w directory β€” directory is the start up directory for newLISP. Any file reference in a program will refer to this directory by default as the current directory. This can be used to define a web root directory 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. Without this switch newLISP will 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

Execute a program

newlisp myprog.lsp

Execute 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 issuing 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 🌸


and that's the whole page, bestie. this doc is from version 10.7.2, dated May 2017 β€” a whole vintage era, and we stan. go write some lisp 🫢✨