New auto-loading features are working

Brian Rice water at tunes.org
Thu Jun 2 21:57:48 PDT 2005


I've uploaded new images to the alpha area, along with a text file  
that acts as mini database for auto-loading functions, similar to the  
previous introduction of the feature I gave in:

http://lists.tunes.org/archives/slate/2005-April/001367.html

However, this time, there is no bootstrap-time processing required, / 
and/ the process works more generically.

Specifically:
There is an in-memory Dictionary which tracks all of the Path  
definitions and the files they are associated with (which source  
files define them).
Every time a Path resolves, it checks this database for further auto- 
loaders and sets them up for further resolution as needed. This means  
that you can define "foo bar" in one place, and "foo bar baz"  
elsewhere, and the system will handle their auto-loading  
independently - the previous incarnation could not do this.

This is encapsulated in an object called "AutoLoader" in the globals  
namespace. It is defined in module.slate, and the protocol is as  
follows:

AutoLoader readFromSourceIn: filePathName
     reads the source code in the specified file, and adds entries to  
the in-memory database.
AutoLoader install:when:isCalledOn:
     handles each entry for an auto-loader (you should not have to  
call this yourself).
AutoLoader readStorage
     reads any definitions in the "AutoLoad" file (provided with  
alpha now, and the Makefile also grabs it).
AutoLoader writeToStorage
     writes out all in-memory definitions to the "AutoLoad" file,  
after processing all of the standard file
     list (defined as "AutoLoader standardFiles" - a bunch of  
filename strings).

Bootstrapping will now call a "readStorage" if the "AutoLoad" file is  
available. It has worked successfully so far, and I don't see any  
issues that should arise now, so let me know of any surprises.

I'll add a little section on this to the manual, and probably  
refactor the protocol a little before making another release. Mostly  
I'd like to ship as full a database as possible so that you guys  
don't have to mess with load: call orderings. How does that sound? :)

A reminder: Before you get these files, make sure to be up to date  
with the darcs repository you are using (main and alpha are in sync  
presently, as well). VM rebuilds are not needed, just retrieving the  
new images and the "AutoLoad" database.

--
-Brian




More information about the Slate mailing list