Re: [PATCH] ASDF load-only files

Richard M Kreuter <[email protected]> Tue, 24 Apr 2007 19:43:47 -0400
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
Jan UrbaƄski <[email protected]> writes:

> I'm using ASDF in a university assignement and I needed the ability
> to tell ASDF to load a file without prior compilation (I'm using
> some packages that contain non-FAS-dumpable code). I skimmed through
> the list archives and found one patch proposal, followed by a
> discussion that I believe did not end in anything constructive.

The proposal a while back was more complex than the one below, in that
it called for load-only-ness at the granularity of the components,
whereas you're talking about the granularity of the whole system.

I think this was mentioned in the discussion a couple of months ago:
asdf is extensible, and so you can devise a load-only-ness of your
preference using asdf's existing protocols, without touching asdf.lisp
itself.  For what you want to do, add a subclass of asdf:system, add
the methods for perform and operation-done-p, and define your class
with:

  (defsystem my-system
    :class load-only-system
    ...)

If you need to write many such systems, the customary way to ensure
that the prerequisite asdf extensions get loaded is to package the
extension as an asdf system, and put something like the following at
the top of your .asd files:

  (eval-when (:load-toplevel :execute)
    (asdf:operate 'asdf:load-op 'load-only-system-extension))

Finally notice that if your load-only systems are not the dependencies
of other systems, then you can load them using asdf's load-source-op
operation, e.g.,

  (asdf:oos 'asdf:load-source-op 'my-system)

If you only ever load a system via load-source-op, then you needn't go
to the trouble of subclassing asdf:system.  However, if any system
should ever depend on one of these systems that should not be
compiled, then load-op's on the dependent system will induce
compile-ops on the dependency system.

--
Richard


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
cclan-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cclan-list