Hi!
I'm working on a project to generate deb packages directly from asdf
files (if it works, will be published open sourced).
I need to parse a component definition form and work with the generated
object, so I'm using asdf::parse-component-form for this, but it first
searches the component (using asdf::find-component) and if it doesn't
exist, then makes a new instance but the desired behaviour in this case
is always generate a fresh instance. I've extended it so it can accept
an optional parameter, 'reuse-instance to get the desired behaviour
(patch attached).
Furthermore, IMHO, asdf::parse-component should be exported so it makes
easier to develop asdf extensions.
Am I missing something? Is the attached patch acceptable?
Thank you
--
+-----------------
| Francisco Vides Fernández <[email protected]>
| Gerente
| Teléfono fijo: 952 60 29 59
| Fax: 952 60 29 59
| Dédalo Ingenieros http://www.dedaloingenieros.com/
| PGP: http://pgp.rediris.es:11371/pks/lookup?op=index&search=0xB1299C15
+------
=== modified file 'asdf.lisp'
--- asdf.lisp 2011-06-02 02:07:52 +0000
+++ asdf.lisp 2011-06-03 12:08:59 +0000
@@ -2594,7 +2594,7 @@
(%remove-component-inline-methods component)
(%define-component-inline-methods component rest))
-(defun* parse-component-form (parent options)
+(defun* parse-component-form (parent options &optional (reuse-instance t))
(destructuring-bind
(type name &rest rest &key
;; the following list of keywords is reproduced below in the
@@ -2629,7 +2629,7 @@
depends-on serial in-order-to)
rest))
(ret
- (or (find-component parent name)
+ (or (and reuse-instance (find-component parent name))
(make-instance (class-for-type parent type)))))
(when weakly-depends-on
(appendf depends-on (remove-if (complement #'find-system) weakly-depends-on)))
_______________________________________________
asdf-devel mailing list
[email protected]
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel