Previous Section Next Section Table of Contents Glossary Index

Chapter 18. Modifying Clozure CL

18.2. Using Clozure CL in "development" and in "user" mode

As it's distributed, Clozure CL starts up with *PACKAGE* set to the CL-USER package and with most predefined functions and methods protected against accidental redefinition. The package setting is of course a requirement of ANSI CL, and the protection of predefined functions and methods is intended to catch certain types of programming errors (accidentally redefining a CL or CCL function) before those errors have a chance to do much damage.

These settings may make using Clozure CL to develop Clozure CL a bit awkward, because much of that process assumes you are working in the CCL package is current, and a primary purpose of Clozure CL development is to redefine some predefined, builtin functions. The standard, "routine" ways of building Clozure CL from sources (see ) - COMPILE-CCL, XCOMPILE-CCL, and XLOAD-LEVEL-0 - bind *PACKAGE* to the "CCL" package and enable the redefinition of predefined functions; the symbols COMPILE-CCL, XCOMPILE-CCL, and XLOAD-LEVEL-0 are additionally now exported from the "CCL" package.

Some other (more ad-hoc) ways of doing development on Clozure CL—compiling and/or loading individual files, incrementally redefining individual functions—may be awkward unless one reverts to the mode of operation which was traditionally offered in Clozure CL. Some Clozure CL source files - especially those that comprise the bootstrapping image sources and the first few files in the "cold load" sequence - are compiled and loaded in the "CCL" package but don't contain (IN-PACKAGE "CCL") forms, since IN-PACKAGE doesn't work until later in the cold load sequence.

The somewhat bizarre behavior of both SET-USER-ENVIRONMENT and SET-DEVELOPMENT-ENVIRONMENT with respect to the special variables they affect is intended to allow those constructs to take effect when the read-eval-print loop next returns to a top-level '? ' prompt; the constructs can meaningfully be used inside LOAD, for instance (recall that LOAD binds *PACKAGE*), though using both constructs within the same LOAD call would likely be pretty confusing.

"user" and "development" are otherwise very generic terms; here they're intended to enforce the distinction between "using" Clozure CL and "developing" it.

The initial environment from which Clozure CL images are saved is one where (SET-USER-ENVIRONMENT T) has just been called; in previous versions, it was effectively as if (SET-DEVELOPMENT-ENVIRONMENT T) had just been called.

Hopefully, most users of Clozure CL can safely ignore these issues most of the time. Note that doing (SET-USER-ENVIRONMENT T) after loading one's own code (or 3rd-party code) into Clozure CL would protect that code (as well as Clozure CL's) from accidental redefinition; that may be useful in some cases.


Previous Section Next Section Table of Contents Glossary Index