[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue: DEFPACKAGE (Version 7)



Here's an excerpt from Version 7:

  It is noted that DEFPACKAGE cannot be used to create two "mutually
  recursive" packages, such as:
   (defpackage my-package
     (:use lisp your-package)           ;requires 'your-package' to exist first
     (:export "MY-FUN"))
   (defpackage your-package
     (:use lisp)
     (:import-from my-package "MY-FUN") ;requires 'my-package' to exist first
     (:export "MY-FUN"))
  However, nothing prevents one from using the package-effecting functions 
  such as USE-PACKAGE, IMPORT, and EXPORT to establish such links (which
  ought to be very rare) after a more standard use of DEFPACKAGE.


The problem is similar to "defining" a circular list; typically you
have to start out with a non-circular "definition" [e.g., such as
by (CONS 'A NIL)] and then make a circularizing step [e.g., such as
(RPLACD X X)].

Your two-pass approach would *probably* work in many reasonable 
implementations, even though the two passes would be "at variance"
by the definitions given previously.  The problem still seems to
be that we "ran out of time" before agreeing on how to reconcile
two defpackage calls that weren't basically the same.


-- JonL --