Re: Adding a generic function layer inside OPERATE
Gary King <[email protected]>
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
Hmmm, this may be tricky. Here is the trace output from running compile-op on a fairly simple system (moptilities). It's not a completely fresh system so the sub-systems are just loaded, not compiled... > (trace asdf::operate asdf:perform) > NIL > ? (asdf:oos 'asdf:compile-op 'moptilities) > Calling (ASDF:OPERATE ASDF:COMPILE-OP MOPTILITIES) > ; loading system definition from user-home:darcs;asdf- > systems;moptilities.asd.newest into #<Package "ASDF0"> > ; registering #<SYSTEM MOPTILITIES #x84E7E1E> as MOPTILITIES > ; loading system definition from /Users/gwking/.asdf-install-dir/ > systems/closer-mop.asd into #<Package "ASDF0"> > ; registering #<SYSTEM #:CLOSER-MOP #x84FEB2E> as CLOSER-MOP > ; loading system definition from /Users/gwking/.asdf-install-dir/ > systems/lw-compat.asd into #<Package "ASDF0"> > ; registering #<SYSTEM #:LW-COMPAT #x84F705E> as LW-COMPAT > Calling (ASDF:PERFORM #<LOAD-OP NIL #x850F17E> #<CL-SOURCE-FILE > "lw-compat-package" #x84F5496>) > ASDF:PERFORM returned (#P"/Users/gwking/.asdf-install-dir/site/lw- > compat/openmcl-1.0-darwin-powerpc/lw-compat-package.dfsl") > Calling (ASDF:PERFORM #<LOAD-OP NIL #x850F17E> #<CL-SOURCE-FILE > "lw-compat" #x84F5016>) > ASDF:PERFORM returned (#P"/Users/gwking/.asdf-install-dir/site/lw- > compat/openmcl-1.0-darwin-powerpc/lw-compat.dfsl") > Calling (ASDF:PERFORM #<LOAD-OP NIL #x850F17E> #<SYSTEM "lw- > compat" #x84F705E>) > ASDF:PERFORM returned NIL > Calling (ASDF:PERFORM #<LOAD-OP NIL #x84F01C6> #<CL-SOURCE-FILE > "closer-mop-packages" #x84FCBDE>) > ASDF:PERFORM returned (#P"/Users/gwking/.asdf-install-dir/site/ > closer-mop/mcl/openmcl-1.0-darwin-powerpc/closer-mop-packages.dfsl") > Calling (ASDF:PERFORM #<LOAD-OP NIL #x84F01C6> #<CL-SOURCE-FILE > "closer-mop" #x84FC75E>) > ASDF:PERFORM returned (#P"/Users/gwking/.asdf-install-dir/site/ > closer-mop/mcl/openmcl-1.0-darwin-powerpc/closer-mop.dfsl") > Calling (ASDF:PERFORM #<LOAD-OP NIL #x84F01C6> #<MODULE "mcl" > #x84FCF26>) > ASDF:PERFORM returned NIL > Calling (ASDF:PERFORM #<LOAD-OP NIL #x84F01C6> #<CL-SOURCE-FILE > "closer-mop-utility-packages" #x84FBE56>) > ASDF:PERFORM returned (#P"/Users/gwking/.asdf-install-dir/site/ > closer-mop/openmcl-1.0-darwin-powerpc/closer-mop-utility- > packages.dfsl") > Calling (ASDF:PERFORM #<LOAD-OP NIL #x8424B66> #<SYSTEM "closer- > mop" #x8427496>) > ASDF:PERFORM returned NIL > Calling (ASDF:PERFORM #<COMPILE-OP NIL #x8424046> #<STATIC-FILE > "notes.text" #x8422E1E>) > ASDF:PERFORM returned NIL > Calling (ASDF:PERFORM #<COMPILE-OP NIL #x8424046> #<MODULE "dev" > #x8423486>) > ASDF:PERFORM returned NIL > Calling (ASDF:PERFORM #<COMPILE-OP NIL #x8424046> #<STATIC-FILE > "index.lml" #x842240E>) > ASDF:PERFORM returned NIL > Calling (ASDF:PERFORM #<COMPILE-OP NIL #x8424046> #<MODULE > "source" #x842272E>) > ASDF:PERFORM returned NIL > Calling (ASDF:PERFORM #<COMPILE-OP NIL #x8424046> #<MODULE > "website" #x8422A56>) > ASDF:PERFORM returned NIL > Calling (ASDF:PERFORM #<COMPILE-OP NIL #x8424046> #<SYSTEM > "moptilities" #x842393E>) > ASDF:PERFORM returned NIL > ASDF:OPERATE returned NIL It looks like ASDF does stuff to the components of a system and then to the system itself. As I understand it, operate calls traverse to figure out all of the steps that need to be done and then does them in linear order. Since there is no recursion, it may be hard to get the desired behavior easily. On the other hand, it might not be too hard to get traverse to add some sort of start-operation and end- operation steps. Having these as separate steps would make it harder to wrap things up nicely (though you could save state in the component objects themselves) but I think it would work. opinions? On Jun 6, 2006, at 10:28 AM, Sean Ross wrote: > I'd also find a patch along these lines quite useful. I'm looking > for a > way to set up and tear down a database connection when loading a > project > and a patch like this would allow me to do exactly that. > > - Sean. > _______________________________________________ > cclan-list mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/cclan-list -- Gary Warren King metabang.com http://www.metabang.com/ (413) 210 7511 gwking on #lisp (occasionally)