2 Customizing the Lisp Environment
shell
orrun-program
; the programs that are invoked inherit the modifications. Environment variables that have been changed or added revert to their original values when Lisp exits.The following function allows you to create, access, modify, and delete environment variables from within the Lisp environment:
environment-variableThis function returns the value of a specified environment variable. You can also use this function with the Common Lisp macro
setf
to set the value of or delete an environment variable. If you set the value of an environment variable that does not already exist, the variable is automatically created. Similarly, if you set the value of an environment variable tonil
, the variable is automatically deleted. Liquid Common Lisp provides additional environment variables for setting up the Lisp environment. These variables set the string values returned by the Common Lisp functionsmachine-type
, machine-version
, software-version
, short-site-name
, and long-site-name
respectively:
LISP_LONG_SITE_NAME LISP_MACHINE_TYPE (not available for LCL/HP and LCL/SGI) LISP_MACHINE_VERSION LISP_SHORT_SITE_NAME LISP_SOFTWARE_VERSION (not available for LCL/HP and LCL/SGI)To set the values of these variables from the UNIX operating system or from a C shell, you must use the command
setenv
before invoking Lisp, as the following example demonstrates:% setenv LISP_MACHINE_VERSION "ROSIE" % lispIf you are working in a Bourne shell, use this technique to set the value of the environment variable before invoking Lisp:
$ LISP_MACHINE_VERSION=ROSIE $ export LISP_MACHINE_VERSION $ lispIt is not necessary to enclose the value of the environment variable in double quotation marks unless it contains more than one word.
You could add these commands to your initialization file if you wanted to set the values of these variables each time you started up Lisp, or you could save them as part of a Lisp image.
Regardless of the method used to set these variables, you can check their values by using the appropriate Common Lisp function from within Lisp:
> (machine-version) "ROSIE"
Generated with Harlequin WebMaker