manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.2 Environment Variables

The environment is a feature of the operating system; it consists of a collection of variables with names and values. Each variable is called an environment variable (or, sometimes, a “shell variable”); environment variable names are case-sensitive, and it is conventional to use upper-case letters only. The values are all text strings, even those that are written as numerals. (Note that here we are referring to names and values that are defined in the operating system shell from which Guile is invoked. This is not the same as a Scheme environment that is defined within a running instance of Guile. For a description of Scheme environments, see section Names, Locations, Values and Environments.)

How to set environment variables before starting Guile depends on the operating system and, especially, the shell that you are using. For example, here is how to tell Guile to provide detailed warning messages about deprecated features by setting GUILE_WARN_DEPRECATED using Bash:

$ export GUILE_WARN_DEPRECATED="detailed"
$ guile

Or, detailed warnings can be turned on for a single invocation using:

$ env GUILE_WARN_DEPRECATED="detailed" guile

If you wish to retrieve or change the value of the shell environment variables that affect the run-time behavior of Guile from within a running instance of Guile, see Runtime Environment.

Here are the environment variables that affect the run-time behavior of Guile:

GUILE_AUTO_COMPILE

This is a flag that can be used to tell Guile whether or not to compile Scheme source files automatically. Starting with Guile 2.0, Scheme source files will be compiled automatically, by default.

If a compiled (‘.go’) file corresponding to a ‘.scm’ file is not found or is not newer than the ‘.scm’ file, the ‘.scm’ file will be compiled on the fly, and the resulting ‘.go’ file stored away. An advisory note will be printed on the console.

Compiled files will be stored in the directory ‘$XDG_CACHE_HOME/guile/ccache’, where XDG_CACHE_HOME defaults to the directory ‘$HOME/.cache’. This directory will be created if it does not already exist.

Note that this mechanism depends on the timestamp of the ‘.go’ file being newer than that of the ‘.scm’ file; if the ‘.scm’ or ‘.go’ files are moved after installation, care should be taken to preserve their original timestamps.

Set GUILE_AUTO_COMPILE to zero (0), to prevent Scheme files from being compiled automatically. Set this variable to “fresh” to tell Guile to compile Scheme files whether they are newer than the compiled files or not.

See section Compiling Scheme Code.

GUILE_HISTORY

This variable names the file that holds the Guile REPL command history. You can specify a different history file by setting this environment variable. By default, the history file is ‘$HOME/.guile_history’.

GUILE_LOAD_COMPILED_PATH

This variable may be used to augment the path that is searched for compiled Scheme files (‘.go’ files) when loading. Its value should be a colon-separated list of directories, which will be prefixed to the value of the default search path stored in %load-compiled-path.

Here is an example using the Bash shell that adds the current directory, ‘.’, and the relative directory ‘../my-library’ to %load-compiled-path:

$ export GUILE_LOAD_COMPILED_PATH=".:../my-library"
$ guile -c '(display %load-compiled-path) (newline)'
(. ../my-library /usr/local/lib/guile/2.0/ccache)
GUILE_LOAD_PATH

This variable may be used to augment the path that is searched for Scheme files when loading. Its value should be a colon-separated list of directories, which will be prefixed to the value of the default search path stored in %load-path.

Here is an example using the Bash shell that adds the current directory and the parent of the current directory to %load-path:

$ env GUILE_LOAD_PATH=".:.." \
guile -c '(display %load-path) (newline)'
(. .. /usr/local/share/guile/2.0 \
/usr/local/share/guile/site/2.0 \
/usr/local/share/guile/site /usr/local/share/guile)

(Note: The line breaks, above, are for documentation purposes only, and not required in the actual example.)

GUILE_WARN_DEPRECATED

As Guile evolves, some features will be eliminated or replaced by newer features. To help users migrate their code as this evolution occurs, Guile will issue warning messages about code that uses features that have been marked for eventual elimination. GUILE_WARN_DEPRECATED can be set to “no” to tell Guile not to display these warning messages, or set to “detailed” to tell Guile to display more lengthy messages describing the warning. See section Deprecation.

HOME

Guile uses the environment variable HOME, the name of your home directory, to locate various files, such as ‘.guile’ or ‘.guile_history’.

LTDL_LIBRARY_PATH

Guile now adds its install prefix to the LTDL_LIBRARY_PATH.

Users may now install Guile in non-standard directories and run ‘/path/to/bin/guile’, without having also to set LTDL_LIBRARY_PATH to include ‘/path/to/lib’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on February 3, 2012 using texi2html 5.0.