{Begin SubSec GAINSPACE} {Title GAINSPACE} {Text For users with large programs and data bases, the user may sometimes find himself in a situation where he needs to obtain more space, and is willing to pay the price of eliminating some or all of the context information that the various user-assistance facilities such as the programmer's assistant, file package, CLISP, etc., have accumulated during the course of his session. The following function is available for this purpose. {FnDef {FnName GAINSPACE} {FnArgs } {Text Prints a list of deletable objects, allowing the user to specify at each point what should be discarded and what should be retained. }} For example: {lispcode _ (GAINSPACE) purge history lists ? {it Y}es purge everything, or just the properties, e.g., SIDE, LISPXPRINT, etc. ? just the properties discard definitions on property lists ? {it Y}es discard old values of variables ? {it Y}es erase properties ? {it N}o erase CLISP translations? {it Y}es . . .} {fn GAINSPACE} is driven by the list {var GAINSPACEFORMS}{index GAINSPACEFORMS Var}. Each element on {var GAINSPACEFORMS} is of the form {lisp ({arg PRECHECK} {arg MESSAGE} {arg FORM} {arg KEYLST})}. If {arg PRECHECK}, when evaluated, returns {lisp NIL}, {fn GAINSPACE} skips to the next entry. For example, the user will not be asked whether or not to purge the history list if it is not enabled. Otherwise, {fn ASKUSER} ({PageRef Fn ASKUSER}) is called with the indicated {arg MESSAGE} and the (optional) {arg KEYLST}. If the user responds {lisp N}o, i.e., {fn ASKUSER} returns {lisp N}, {fn GAINSPACE} skips to the next entry. Otherwise, {arg FORM} is evaluated with the variable {var RESPONSE}{index RESPONSE Var} bound to the value of {fn ASKUSER}. In the above example, the {arg FORM} for the "{lisp purge history lists}" question calls {fn ASKUSER} to ask "{lisp purge everything, {ellipsis}}" only if the user had responded {lisp Y}es. If the user had responded with {lisp E}verything, the second question would not have been asked. The "{lisp erase properties}" question is driven by a list {var SMASHPROPSMENU}.{index SMASHPROPSMENU Var} Each element on this list is of the form {lisp ({arg MESSAGE} . {arg PROPS})}. The user is prompted with {arg MESSAGE} (by {fn ASKUSER}), and if he responds {lisp Y}es, {arg PROPS} is added to the list {var SMASHPROPS}.{index SMASHPROPS Var} The "{lisp discard definitions on property lists}" and "{lisp discard old values of variables}" questions also add to {var SMASHPROPS}. The user will not be prompted for any entry on {var SMASHPROPSMENU} for which all of the corresponding properties are already on {var SMASHPROPS}. {var SMASHPROPS} is initially set to the value of {var SMASHPROPSLST}.{index SMASHPROPSLST Var} This permits the user to specify in advance those properties which he always wants to be discarded, and not be asked about them subsequently. After finishing all the entries on {var GAINSPACEFORMS}, {fn GAINSPACE} checks to see if the value of {var SMASHPROPS} is non-{lisp NIL}, and if so, does a {fn MAPATOMS}, i.e., looks at every atom in the system, and erases the indicated properties. Note that the user can change or add new entries to {var GAINSPACEFORMS} or {var SMASHPROPSMENU}, so that {fn GAINSPACE} can also be used to purge structures that the user's programs have accumulated. }{End SubSec GAINSPACE}