From: Christophe R. <cs...@ca...> - 2002-12-02 09:13:26
|
On Sun, Dec 01, 2002 at 04:15:40AM +0200, Valtteri Vuorikoski wrote: > ok, I just figured out a bug here. The code interacts wrongly when > inheritance crossing package boundaries is involved, so let's add > another case: > > 5. :include with the same :conc-name in different packages: > > (in-package :a) > (defstruct (s1 (:conc-name foo-)) a) > (in-package :b) > (defstruct (s2 (:include a:s1) (:conc-name foo-)) b) > > This will create an accessor A:FOO-A as expected. However: > > Old behavior: accessors FOO-A and FOO-B each taking an argument > of type S2 will be created in package B. > New behavior: is the same as old behavior, since the INHERITED-ACCESSORS > list that S2 will get only contains the symbol A:FOO-A and the newly minted > ACCESSOR-NAME of inherited slot A's DSD will be B:FOO-A. > > I think the right thing to do here would be to import the definition > of FOO-A from package A into package B, such that this B:FOO-A can be > used to access both instances of S1 and S2 (as happens when no package > boundaries are crossed)? I don't think so... I would have thought that A:FOO-A is the accessor that would be usable to access both S1s and S2s, (and also frankly that anyone who's programming like this probably deserves to lose :-)... I certainly think that automagic importing of definitions would be a very bad thing. > In other news, the STYLE-WARN lossage I mentioned in the previous post > happens during force-delayed-defbangstructs. I'm not certain whether > there's a sane way of avoiding an attempt to issue a warning here, > besides disabling the warning code during cross-compile? > But I didn't look at this too closely yet. Well, what is the warning? Is it actually pointing at bad code in SBCL itself? I look forward to looking at it more closely. Cheers, Christophe -- http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757 (set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b))) (defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge) |