set-case-mode

$Revision: 5.0.2.4 $

Function

Package: EXCL

Arguments: (new mode)

This function sets the case mode of Lisp to that specified by the new-mode argument. The value of that argument must be one of the following three keywords: :case-insensitive-upper, :case-insensitive-lower, and :case-sensitive-lower. (Earlier versions on Unix also supported :case-sensitive-upper but Allegro CL 5.0 does not support that mode.) set-case-mode converts the running Lisp to use the new mode for subsequent reading and returns a keyword denoting the previous mode. This function must do quite a bit of consistency checking when changing between modes with different case preferences, and may take as long as several minutes to complete.

If Lisp is built with the Presto feature, this function will not allow users to destructively change symbol names from uppercase to lowercase or lowercase to uppercase. set-case-mode will always allow uses to change the reader sensitivity. (If a Lisp is built with :presto t specified to build-lisp-image, then the Lisp is built with Allegro Presto.)

If CLX has been loaded into Lisp, you cannot change the case mode at all with this function. unfortunately, no error is signaled but problems will occur later. Note that both Allegro Composer and Allegro Common Windows (both only available on Unix) use CLX.

This function can be called at anytime but should, if possible, be called as the first action in a fresh invocation of Lisp. It is likely that the system will not be able to resolve conflicts if case mode is changed after Lisp has been running for some time. However, sometimes it is necessary to change case modes more than once. Suppose you want to work in case-sensitive, lowercase preferred mode but need to load files written for a standard (case-insensitive, uppercase) Lisp. You might first set the mode to :case-insensitive-lower, load the files, and then set the mode to the desired :case-sensitive-lower.

This function can be used to create a Lisp image with a different case mode than that set when Lisp was installed, using, for example, the following sequence of forms entered immediately after Lisp starts up:

;; We change to :CASE-SENSITIVE-LOWER:
(excl:set-case-mode :case-sensitive-lower)
(excl:dumplisp :name "cl-lower.dxl")
(exit)

When the excl:dumplisp form completes, you will have a case-sensitive-lower image named cl-lower.dxl.

See case.htm for general information on case in Allegro CL.

The general documentation description is in introduction.htm. The index is in index.htm.

Copyright (C) 1998-1999, Franz Inc., Berkeley, CA. All Rights Reserved.