| Yet
another Defsystem -Compiling and Loading a System To compile and load or otherwise operate on a system, the function MK is used. MK stands for "Make", and its syntax is as follows: (mk <name> <keyword-value-pairs>...) The name is the name of a system, which should be defined in a file named "name.system" in a registry folder. To compile and load a system named "frobozz", just evaluate (mk :frobozz) You can also use a string or a non-keyword symbol to specify the name of the system. YADS will load the system definition and compile and load each file as necessary. It will also require all needed modules, and recursively MK any systems the system depends on. No file or module will be loaded more than once, so circularities do not create any problems. If you have defined any :INITIALLY-DO or :FINALLY-DO forms, they will evaluated in due order. KeywordsMK accepts the following keyword-value
pairs: :ACTION :LOAD is the default. MK goes through the files in the system, compiling and loading as necessary. If there is no source file for a particular binary, a warning is printed. If a binary can't be found or if it is old (meaning that its corresponding source file has been changed since the binary last was loaded), a new binary is produced and loaded. It is an error if the source file cannot be found. If :COMPILE-P is false for the component, a binary is not produced: the source file is loaded instead. External systems are compiled only if their :COMPILE-EXTERNAL-P flag is set; if not, and there is a more recent source in an external system, then that source file will be loaded instead of the obsolete binary. :ACTION :COMPILE is similar, but sources files are never loaded in absence of binaries, and all modules and systems depending on a module are also recompiled. There is rarely any need to use this option. :ACTION :DELETE-BINARIES removes all binaries belonging to this system. It does not remove binaries in external systems. :ACTION :SEARCH looks for the string given by the keyword :ARG1 among the sources of the system. A dialog box showing all matching files will be shown. :ACTION :REPLACE replaces one string by another, using :ARG1 for the search string and :ARG2 for the replacement string. It is currently unimplemented (="left as an exercise for the reader"). :ACTION :OPEN looks for the source file named by :ARG1 and opens it for editing. If there are more than one file of the same name, all are opened. :ACTION :PRINT produces hardcopy of all files in a system. Here are a few examples:
Command Abbreviations A few operations are so common that we have defined "abbreviations" for them:
Editing the System DefinitionThe function MK-ED takes a system name and opens an editor window for that file, letting you edit the system definition: (mk-ed :baz) The file "Baz.system" in the appropriate central registry folder will be opened for editing. Obtaining a file listSometimes you need an list of all the source files of a system sorted by load order. This is sometimes handy if you need to produce a load file for somebody who is not using a DEFSYSTEM utility. The function FILE-COMPONENT-LIST is used to produce a load-ordered source file list. It takes two arguments: (file-component-list <name> <include-externals-p>) The name is the name
of a system. If include-externals-p is true, the list will include
the files of all external systems loaded by :DEPENDS-ON forms as well (and
any systems loaded by them in their turn, and so on).
|