Saving to Disk



next up previous contents index
Next: The Pager Up: The REDUCE Environment Previous: The REDUCE Environment

Saving to Disk

  In addition to saving environments within the system, REDTEN includes a package to allow the user to save an environment to disk for later use. The same data structures are used to find the names of things to save, and all stored environments are also saved. This package was intended primarily for the saving of indexed objects and the environment in which they were created, so that they could be re-introduced into a subsequent REDUCE session.

There are two routines in the disk-saving package: savei() and savec(). savei() is used to save indexed objects in internal form, so that they may be used again in normal fashion. savec() is similar to savei() in terms of saving the environment, but saves indexed objects in component form: new variables of the form <name><index> are created, each holding a component of the object <name> with fixed index <index>. When reloaded, the components of these objects must be used as normal algebraic variables, the indexed-object structure is no longer present.

Both of these routines save the entire current REDUCE environment, and any saved environments. The required first argument of each is a file name conforming to the local conventions about such, usually it will be a string enclosed in double quotes. Any remaining arguments are taken to be the names of indexed objects, and patterns may be used. The output file contains lisp code and can be re-read via the usual REDUCE in() command. During both the save and reload operations, the name of each saved or restored symbol is echoed to the screen.



John Harper
Wed Nov 16 13:34:23 EST 1994