uses-macros-from loads all dependent systems

0 views
Skip to first unread message

Tobias Rautenkranz

unread,
Apr 19, 2009, 5:39:31 AM4/19/09
to mudballs
Hi Sean,

I think the use of DO-SYSTEMS in ensure-dependencies-up-to-data is wrong since
it iterates over all available systems and thus loads any dependant system
regardless whether it is loaded.

CL-USER> (in-package :sysdef)
#<PACKAGE "MB.SYSDEF">
SYSDEF> (define-system :a ())
#<SYSTEM :A 0.0.1 {AB67EF9}>
SYSDEF> (define-system :b () (:uses-macros-from :a))
#<SYSTEM :B 0.0.1 {AC1B129}>
SYSDEF> (system-loaded-p :b)
NIL
SYSDEF> (mb:load :a)
#<SYSTEM :A 0.0.1 {BC0F201}>
SYSDEF> (system-loaded-p :b)
#<SYSTEM :B 0.0.1 {BC0F291}>

Something like this should work:
diff --git a/sysdef.lisp b/sysdef.lisp
index 2591cf0..fed3659 100644
--- a/sysdef.lisp
+++ b/sysdef.lisp
@@ -2492,9 +2492,11 @@ has been loaded into the the current Lisp image or
nil.")
(defgeneric ensure-dependencies-up-to-date (system)
(:method ((system system))
(when *mudballs-loaded*
- (do-systems (sys)
- (when (on-macro-use-list sys system)
- (execute sys 'load-action))))))
+ (maphash #'(lambda (name sys)
+ (declare (ignore name))
+ (when (on-macro-use-list sys system)
+ (execute sys 'load-action)))
+ *loaded-versions*))))

(defmethod execute :before ((system system) (action source-file-action))
(let ((loaded-system (system-loaded-p (name-of system))))

signature.asc

Sean Ross

unread,
Apr 19, 2009, 7:25:11 AM4/19/09
to mudb...@googlegroups.com

On 19 Apr 2009, at 10:39, Tobias Rautenkranz wrote:

> Hi Sean,
>
> I think the use of DO-SYSTEMS in ensure-dependencies-up-to-data is
> wrong since
> it iterates over all available systems and thus loads any dependant
> system
> regardless whether it is loaded.
>


Thanks for the fix, I've pushed this onto the github repository.

sean.

Reply all
Reply to author
Forward
0 new messages