Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lisp(1) — HP-UX 9.03

Media Vault

Software Library

Restoration Projects

Artifacts Sought

lisp(1)

Optional Lisp Software Required

NAME

lisp − HP Common Lisp environment

SYNOPSIS

lisp [options]

DESCRIPTION

lisp is the HP Common Lisp environment.  It is provided in the following versions:

Series 300/400: Lucid version 2.15

Lucid version 4.0

Series 800: Lucid version 3.0

Lucid version 4.0

This manual entry focuses on HP Common Lisp version 4.0. 

You can specify options when invoking the Lisp environment (see the section Options below).  Once in the environment, you can compile functions, files, execute and debug programs, use the Lisp editor, have multiple processes running at the same time, use the windowing system, take advantage of the delivery tool kit to optimize Lisp programs, or use the the Common Lisp Object System (CLOS).  Refer to the HP Common Lisp User’s Guide for more information. 

Invoking Lisp

To invoke Lisp, type the Lisp environment or image name on the keyboard and press Return.  For example, to invoke the Lisp environment from a Lisp image called mylisp, use the command:

mylisp [Return]

Shell environment variables can also be used to invoke a Lisp environment.  First, set and export the variable in your .profile file (Bourne, or Korn, or POSIX Shell) or set the variable in your .login file (C Shell).  For example, if using Korn Shell, add the following to .profile:

LISP=/usr/lib/lisp/lisp-dev/lisp-de
export LISP

To invoke Lisp, type:

$LISP [Return]

Using this method, there is no need to update the environment variable until you move Lisp to a new directory or change the image name. 

To initialize the Lisp environment when Lisp is invoked, create a file named lisp-init.lisp in your home directory.  This initialization file can then be compiled for faster performance.  lisp-init is loaded whenever Lisp is invoked, and all Lisp expressions in the file are evaluated. 

Another variable called *enter-top-level-hook* can be set to control the behavior of Lisp when Lisp is started.  If the variable is bound to a compiled function or a symbol that names a compiled function, that function is called before Lisp enters the top level. 

Options

The following command-line options are recognized when invoking the lisp environment. 

-load|-l filename Load the specified file when starting Lisp. 

-no-init-file|-n Do not load the initialization file.  The initialization file is init-lisp.lisp or init-lisp.hbin. 

-eval|-e form Evaluate form. The return value is lost. Produces side-effects only.

-quit|-q Terminate the Lisp environment.  To terminate Lisp from the top level of the Lisp environment, type (quit). 

Lisp Compilation and Execution

The options listed under the commands below all start with : The options listed are not discussed in detail in this document.  For more information on the commands and their options, refer to the HP Common Lisp User’s Guide.

(compile-file "path / filename" [:output-file "outputname" ]

[compiler-options

:messages :file-messages
:warnings :undef-warnings
:show-optimizations
:fast-entry :write-safety
:read-safety :tail-merge
:notinline :egc ])

Compile-file compiles the Lisp source file specified by path/filename.  If no path is specified, Lisp uses the value of *default-pathname-defaults* to look for a file.  The compiled code name is placed in a file having the same name as the source, except it ends in .hbin or .6bin.  If the :output-file "outputname" option is specified, the compiled code is named outputname.

Use compiler options to control the code optimization, increase the speed of compiled code, control the size of compiled code, suppress warnings, convert tail-recursive calls to iterative constructions, and enable execution of code during ephemeral garbage collection.  Enter options when calling compile-file or by calling compiler-options first followed by compile-file. 

For example, the following commands (denoted in
 
LITERAL typeface) entered from the Lisp environment:

> (compiler-options :warnings nil
:show-optimizations t)
> (:WARNINGS NIL :SHOW-OPTIMIZATIONS T)
> (compile-file "dr.l" :output-file " mydr.hbin")

cause the dr.l Lisp source code to be compiled with compiler warning messages suppressed and code optimizations reported to the terminal.  The compiled code will be written to a file called mydr.hbin. 

(load filename [ :verbose :print :if-does-not-exist
:if-source-only :if-source-newer
:ignore-binary-dependencies ])

Read and evaluate all forms in filename (i.e. load binary code after it is compiled so that it is available for use). 

filename can be a pathname, stream, string, or a symbol.  Specify load options to:

• Compile a source file first and then load it if the binary file did not exist when calling load. 

• Print the values of all expressions that are loaded. 

• Specify that you want to load whichever is newer, the source or the binary code. 

• Load a binary file that was compiled for a certain run-time feature onto a machine that does not have the correct architecture. 

• Load a source file without getting prompted to compile it. 

Communicating With HP-UX

(run-program name [ :input :output :error-output
:wait :arguments
:if-input-does-not-exist
:if-output-exists
:if-error-output-exists ])

Run-program runs HP-UX programs from the Lisp environment.  name contains the full pathname to the program to be run.  This form is used to run shell scripts, specify options to get the HP-UX process id of the program being run, get the error output from a program, get the program exit status, and pass arguments to a program. 

EXAMPLES

The following invokes the Lisp environment, loads a file called myfun, evaluates it (a message will print), and terminates Lisp — all by specifying command-line options when invoking the Lisp environment. 

$ lisp -load "myfun" -eval "(myfun)" -quit
> hi there
$

This example shows how to run the Korn shell from Lisp, execute the ls command, and get back into Lisp. 

> (run-program "/bin/ksh")
$ ls *.l
dr.l
mylisp.l
nl.l
$ exit
NIL
NIL
0
NIL
>

WARNINGS

When running a large application, be sure enough swap space is available to execute the program.  In some cases it may be necessary to ensure that Lisp is the only process running in order to prevent running out of space, causing Lisp to halt. 

DEPENDENCIES

If using the Window Tool Kit, X11 is required. 

Full support is now provided for international character sets, including double-byte character sets such as Kanji.  A double-byte character is considered as one character object so that it is treated in the same manner as a single-byte character. 

To use Kanji, the Japanese Host Input Conversion program (JHIC) which is in the Native Language Input/Output (NLIO) subsystem is needed to convert Roman characters to Katakana, Hiragana, or Kanji characters. 

Kanji characters are displayed in the Window Tool Kit if your terminal supports Japanese characters.  Kanji is not supported in the Editor. 

HP-UX 7.0 is required.  It is NOT supported on prior releases of HP-UX. 

Series 300/400:
HP Common Lisp II 2.15 cannot be installed and run unless you have an ID-module, codeword certificate, and the necessary codeword. 

Series 800:
A color monitor is required when using the color Window Tool Kit.

FILES

Files that end in .l or .lisp are understood to be Lisp source files, although it is not a requirement to end Lisp source files in .l or .lisp.  When compiled, the resulting binary file ends with .6bin on Series 300/400 and .hbin on Series 800 systems. 

Series 300/400:

file.lisp Lisp source file

file.6bin Lisp Binary file

Series 800:

file.lisp Lisp source file

file.hbin Lisp Binary file

AUTHOR

HP Common Lisp was developed by HP and Lucid, Incorporated. 

SEE ALSO

HP Common Lisp User’s Guide, HP Part No. 92640-90002
HP Common Lisp Advanced User’s Guide, HP Part No. 92640-90007
HP Common Lisp Editor, HP Part No. 92640-90009
Common Lisp: The Language, by Guy Steele, Jr., HP Part No. 9320-6047

Hewlett-Packard Company  —  HP-UX Release 9.03: April 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026