[Ecls-list] Strange things with packages

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Mon Dec 29 10:02:55 UTC 2008

On Mon, Dec 29, 2008 at 4:44 AM, David Creelman
<creelman.david at gmail.com> wrote:
> Hi,
> I'm working on a utility called cl-remind (git://github.com/kreely/cl-reminders.git)
> and I'm having a problem with a package using another package.
> my package defs look something like the following :-
> [... package definitions inside .asd files ]

Hi David, your problem is not really with ECL but with our ASDF. You
are assuming that when you do (require 'reminders) the system
defintion for 'dates must have already been loaded. But ASDF cannot
load it until it parses the system definition for REMINDERS and finds
out that it depends on DATES!

Since ASDF does not have this information, it does the following.
First it loads reminders.asd In doing so, the first thing it finds is
a DEFPACKAGE form that it evaluates. This form requires to export
certain symbols from the DATE package and it fails miserably because
that package does not exist yet.

What I have seen people normally do is _NOT_ put the definition file
in the *.asdf file, but do it inside a *.lisp file that it then forms
part of your system definition, as in

(asdf:defsystem :dates
       :version "0.9"
       :components ((:file "dates-pkg") (:file "date-calcs")))
(asdf:defsystem :reminders
       :version "0.9"
       :depends-on (:dates :debug)
       :components ((:file "reminders-pkg")  (:file "reminder-calcs")))

Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28009 (Spain)

More information about the ecl-devel mailing list