On Wed, Dec 7, 2011 at 14:55, Nikodemus Siivola nikodemus@random-state.net wrote:
I want to define a component class PORT-FILE, to be used like this:
:components ((port-file "ccl" :when :ccl) (port-file "clisp" :when :clisp) (port-file "sbcl-x86" :when (and :sbcl :x86)) ...)
The implementation I have adds AROUND methods for
PERFORM (LOAD-OP PORT-FILE) PERFORM (LOAD-SOURCE-OP PORT-FILE) PERFORM (COMPILE-OP SOURCE-FILE)
and does CALL-NEXT-METHOD only if the feature test passes -- which seems to work well enough, but is there a better place to hook into?
That works indeed. I don't have any better option to offer, except maybe to make your featurization a mixin. Also if you rely on 2.018 or later, you can use asdf::featurep internally. You then need :and rather than cl:and, though.
I wish I could say "just use XCVB" at this point, but XCVB isn't as portable or readily available as ASDF.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org Do not consider Collectivists as "sincere but deluded idealists". The proposal to enslave some men for the sake of others is not an ideal; brutality is not "idealistic," no matter what its purpose. Do not ever say that the desire to "do good" by force is a good motive. Neither power-lust nor stupidity are good motives. — Ayn Rand