Hello, good ASDF folk.
I have a situation where I'd like to extend the allowed syntax of dependencies in the ASDF system definition forms.
More specifically, my library provides a decoupling abstraction of "interfaces" and "implementations", where an interface is a set of stub definitions that can be fleshed out into properly working definitions by an implementing system. A system that depends on the definitions of an interface however should not (and cannot) know in advance which specific implementation might be used, so it instead has to depend on a 'virtual system' represented by the interface. The resolution of which specific system should implement the interface is then pushed out as far as possible and only performed when the interface is required as a dependency.
Currently, the library allows you to write system definitions like so in order to facilitate this:
(asdf:defsystem foo ... :depends-on ((:interface :bar) ...))
This extension to the depends-on syntax is done by redefining ASDF/PARSE-DEFSYSTEM:PARSE-DEPENDENCY-DEF to catch my specific case in advance and fall back to the original function definition otherwise. Additionally, ASDF:RESOLVE-DEPENDENCY-COMBINATION is extended by a method to handle the :INTERFACE combinator. This works fine so far, but naturally redefining a function is far less than ideal and reeks of an ugly hack.
I wrote that code more than a year ago and back then I could not see any other way to extend the syntax in a way that seems intented by ASDF. Maybe the situation has changed, or maybe there's better ways to go about it altogether. Hopefully you'll be able to point me in a right direction, or if there currently isn't one, maybe there's a way to make what I want to do intentionally possible.
Thank you for your time and work on ASDF!
Sincerely, Nicolas Hafner
On Sat, Nov 26, 2016 at 4:19 AM, Nicolas Hafner shinmera@tymoon.eu wrote:
This extension to the depends-on syntax is done by redefining ASDF/PARSE-DEFSYSTEM:PARSE-DEPENDENCY-DEF to catch my specific case in advance and fall back to the original function definition otherwise. Additionally, ASDF:RESOLVE-DEPENDENCY-COMBINATION is extended by a method to handle the :INTERFACE combinator. This works fine so far, but naturally redefining a function is far less than ideal and reeks of an ugly hack.
I wrote that code more than a year ago and back then I could not see any other way to extend the syntax in a way that seems intented by ASDF. Maybe the situation has changed, or maybe there's better ways to go about it altogether. Hopefully you'll be able to point me in a right direction, or if there currently isn't one, maybe there's a way to make what I want to do intentionally possible.
parse-defsystem.lisp is probably the remaining part of asdf that received the least love since the days of ASDF 1. There were code cleanups and bug fixes, but the structure of the code and its rigidity are about the same.
If you have proposals on how to make the code extensible, e.g. in the style of resolve-dependency-combination (or as macros that expand to such), then you are most welcome. The test suite will help you make sure you aren't breaking anything — please add to it to make sure noone will break your code.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org Racists often attribute to genetics what is due to memetics. Anti-racists often do the opposite. Both groups involve legal violence where none is due. — Faré