Re: defsystem optionally loaded subsystem

Marco Antoniotti <[email protected]>
Newsgroups gmane.lisp.clocc.devel
Message-ID <[email protected]>
> From: "Liam M. Healy" <[email protected]>
> Cc: [email protected]
> Reply-To: Liam Healy <[email protected]>
> Sender: [email protected]
> X-Original-Date: Mon, 25 Nov 2002 13:45:19 -0500
> Date: Mon, 25 Nov 2002 13:45:19 -0500
> X-UIDL: '[e"!9Wp"!%j<"!N`<!!
> 
> >>>>> "Marco" == Marco Antoniotti <[email protected]> writes:
> 
>     >> From: "Liam M. Healy" <[email protected]>
> 
>     >> In one of my systems, I have a few files whose definitions are
>     >> infrequently used and that are time-consuming to load.  I would like
>     >> to make them optionally load under defsystem-3.x:  they would compile
>     >> with the rest of the system, but would only be loaded with an explicit
>     >> command.  I do not want to make them a separate system because I want
>     >> to keep them associated with this system.  Is there a way to do this
>     >> easily in the defsystem structure?
> 
>     Marco> The way I do it is the group these files into a separate :module with
>     Marco> no (or only few) dependencies.
> 
>     Marco> This way you get compilation and loading of these files only at
>     Marco> specific times.  E.g.
> 
>     Marco> 	 (mk:defsystem "FOO"
>     Marco>               :components ("base"
>     Marco>                            (:module "load-sparingly"
>     Marco>                                     :source-pathname "where/they/are/"
>     Marco>                                     :components ("f1" "f2"))
>     Marco>                            (:file "x"
>     Marco>                                   :depends-on ("base" "load-sparingly"))))
> 
>     Marco> ... I think you get the idea.
> 
> Actually, I don't get the idea.  This looks like an ordinary system
> definition with three pieces, "base", "load-sparingly" and "x", that
> will load when the system loads.  How do you prevent the automatic
> loading of a piece, "load-sparingly" presumably?  How do you trigger
> its loading manually?

Well.  I think we are going in circles.  I am assuming that you will
want to have "f1" and "f2" loaded initially.  The above definition
will do that.   Afterward, "load-sparingly" will get loaded/compiled
only if "base" is changed somehow.  If not, it will not get
loaded/compiled.  But this is the basic defsystem machinery.

I suppose you want something like

  (mk:load-system "FOO" :exclude '("f2"))

This is not implemented.

In MK4 you will be able to say

  (mk4:execute-action (mk4:find-component "FOO" "load-sparingly" "f2") :load)

But, I surmise that even that may not satisfy you.

So the question is: do you have an idea of the functionality that you
may want in defsystem?

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
715 Broadway 10th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.


-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.