[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Edit System is anti-modularity



    Date: Wed, 8 May 1991 09:30 EDT
    From: Tom Shepard <Shepard@MCKENZIE.S&C.Dialnet.Symbolics.COM>
	From: Dodds@YUKON.SCRC.Symbolics.COM (Douglas Dodds)

	I would also comment that making (for example) IP-TCP a component system
	of your own application's system is not the right way to require the
	presence of a generally used system that your system depends on.  The
	right construct for that is to use :REQUIRED-SYSTEMS (:IP-TCP) as an
	option in your DEFSYSTEM.

    This is not documented [as of 8.0.1].  How is the behavior of
    :REQUIRED-SYSTEMS different from using component systems?

Sorry, I thought it was, but wasn't sure.  (In the examples that follow,
the systems that go with the keyword can either be a single system name
or symbol, or a list of them.)

-------------
   :required-systems Option for defsystem

   Specifies the systems that are required to be loaded before this sys-
   tem being defined can be loaded (or compiled). If you try to load a
   system when a required system is missing, SCT gives an error telling
   you that the required system must be loaded first.

   :required-systems allows you to establish dependencies among
   several systems without having to lock in a specific version number,
   as would happen if one system were a component system of the oth-
   er.

	(defsystem registrar
	  (:pretty-name "Automatic Registration System"
	   :short-name "Registration"
	   :default-pathname "reg:reg;"
	   :required-systems "Scheduling Utilities")...)

----------------

	(See also :LOAD-WHEN-SYSTEMS-LOADED, for optional parts of your system
	that have dependencies on generally used systems that might or might not
	be loaded.)

No doubt this is also first documented in 8.1, so to make things clear:

---------------

   :load-when-systems-loaded Option for :module

   The :load-when-systems-loaded option instructs SCT not to load
   some modules of a system when a set of required systems is not
   loaded. When all the required systems become loaded, SCT automati-
   cally loads the unloaded modules.

   Including this option in a module has two effects:

   o  If the required systems are not all loaded, that module is not
     loaded.

   o  When all the required systems become loaded, SCT goes back and
     loads the module.

   o  You cannot safely patch that module, as it might not be loaded yet
     at the time patches are loaded.

   :load-when-systems-loaded differs from the :required-systems
   option to defsystem in that :required-systems gives an error if
   the required systems are not present. :load-when-systems-loaded
   never gives an error. 

   Note that any module that contains the :load-when-systems-
   loaded option should be a named module, so SCT can keep track of
   the unloaded modules by name (since sysdcls can be reloaded).

   Example:

	(defsystem print-spooler
	    (:default-pathname t)
	  (:module unix-spooler ("ux-spool") 
		   (:load-when-systems-loaded :unix-support))
	  (:serial (:parallel "defs" "macros")
		   "spooler"
		   unix-spooler))
   Suppose that the system UNIX-SUPPORT is not loaded. When you load
   the PRINT-SPOOLER system, all the files in the system are loaded ex-
   cept for those files in UNIX-SPOOLER module (namely, UX-SPOOL). If
   and when you load the UNIX-SUPPORT system, the files in the UNIX-
   SPOOLER will get loaded.