Extending ASDF System Depends-On Syntax

Nicolas Hafner shinmera at tymoon.eu
Sat Nov 26 09:19:43 UTC 2016

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
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20161126/37c70597/attachment.sig>

More information about the asdf-devel mailing list