Greetings,<div><br></div><div>I understand the problem - at least to a degree.  With user code, not part of the boot process, I would think that I wouldn't rely too much on lisp magically knowing what to do in complex situations (where different methods are attached to the same generic).  Rather, I would push the problem to the application programmer.  It is his responsibility to make sure everything gets loaded and in the correct order.</div>
<div><br></div><div>I understand there is a different problem with the startup code to some degree.  Off the cuff, what I would do is allow the auto-loading to work for simple cases without anything special - as it works in simple minded situations.  Now for the final case - the case in questions.  Rather than make lisp autoload smarter and smarter - probably never able to make it smart enough, and so complex no one understands it - what I would do is require a programmer written function that explicitly specifies what gets loaded and in what order.  Therefore, when some that isn't loaded gets called, lisp first checks for any of these "special case" situations (which was registered at initial boot time) and runs that if it exists.  If one of these special case functions doesn't exist for that item a simple auto-load algorithm is employed.</div>
<div><br></div><div>Built in ABCL functions that have complex situations can have ABCL developer specific "special case" handling code pre-loaded.  These would have to be maintained when necessary but should be made easy to do so.</div>
<div><br></div><div>This may be a better KISS solution than trying to make auto-load ever-smarter.</div><div><br></div><div>Just some thoughts.</div><div><br></div><div>Blake McBride</div><div><br><br><div class="gmail_quote">
On Wed, Aug 1, 2012 at 7:14 AM, Erik Huelsmann <span dir="ltr"><<a href="mailto:ehuels@gmail.com" target="_blank">ehuels@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<div><br></div><div>Just committed my progress on the automatically generated autoloads. The next step is to clean up "autoloads.lisp" (the file which still exists to allow manual addition/manipulation.</div>

<div><br></div><div>While I can do that step by myself, I'd like to discuss a problem we already have today, just never encountered:</div><div><br></div><div>Generic functions can have methods defined in more than one file. Example: PRINT-OBJECT has its GF defined in print-object.lisp, but has methods defined in print-object.lisp, java.lisp and format.lisp. Clearly, when PRINT-OBJECT is being called for the first time (and hence needs to be autoloaded), it's not correct to autoload java.lisp or format.lisp: we would miss the generic function and if print-object.lisp is loaded later, it'll overwrite the methods already defined.</div>

<div>On the other hand, *only* loading print-object.lisp isn't correct either: we have no idea if the arguments passed to the call should have caused the methods in java.lisp or format.lisp to be triggered.</div><div>

<br></div><div>My current thinking about the above is that we'd need to load all files in which methods are being defined for PRINT-OBJECT. These files should makes sure (through REQUIRE) that they load the file with the generic function first. The autoloading facility should then hook into require in some way or another to make sure it doesn't load files which have been loaded through REQUIRE to prevent out-of-order loading.</div>

<div><br></div><div>Then my next issue is that if one of the files being loaded in the loaded group has symbols which are multi-homed in a different (but overlapping) set of files, those files need to be loaded as well, for the same reasons.</div>

<div><br></div><div><br></div><div>My question is: what are your thoughts on the subject?</div><div><br></div><div>BTW: I have some more questions I'd like to discuss regarding autoloading, but since they are unrelated, I'm holding off posting until discussion on this subject has settled on a general direction for development.</div>

<div><br></div><div><br></div><div>What was autoloading again? Autoloading is a mechanism which allows ABCL to start up quickly by deferring loading of FASLs which it only needs later. Also, helps ABCL to run in memory-restrained environments by loading only the support necessary to run the code at hand. Autoloading is a feature used *only* for ABCL's own FASLs. User-FASLs will always be fully loaded (although I suppose it should be possible to leverage the existing autoloader infrastructure to help users who think they need this for themselves).</div>

<div><br></div><div><br></div><div>Bye,</div><div><br></div><div>Erik.</div>
<br>_______________________________________________<br>
armedbear-devel mailing list<br>
<a href="mailto:armedbear-devel@common-lisp.net">armedbear-devel@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel</a><br>
<br></blockquote></div><br></div>