A plurality of defsystems [was Re: rfc - delay the parsing of system components ]
Richard M Kreuter <[email protected]> Tue, 14 Oct 2008 10:57:51 -0400
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
Gary King writes: > * I don't want to replace ASDF; it;s good, it works, it's in use; > adding a new one just muddies the waters. For my part, I don't see any reason why the Lisp community should constrain itself to having exactly one defsystem facility. ASDF is useful, but it has shortcomings, and since it's never clear which of ASDF's details are intended or accident, and in any case which details are important to anybody, ISTM that it would probably be a good thing if alternative defsystems could co-exist. So I wonder how hard it would be to introduce an interface that insulated users and programs from the details of how a system's construction and loading happens to be implemented. Something like the following seems as though it would suffice: -- BUILD-SYSTEM <NAME> &key &allow-other-keys [Function] Call successive functions in *SYSTEM-BUILDER-HOOKS* using <NAME>, the list of keywords, and :ALLOW-OTHER-KEYS T, until one returns true, and signals an error if no function in *SYSTEM-BUILDER-HOOKS* returns true. *SYSTEM-BUILDER-HOOKS* [Variable] A list of designators for functions that take a string designator and a list of keywords. When called, each function will attempt to build a system identified by the string designator and possibly some of the keyword arguments, and return true if such a system been built, or NIL otherwise. Building a system might have arbitrary side-effects on the Lisp instance, but may not cause it to terminate. LOAD-SYSTEM <NAME> &key &allow-other-keys [Function] Call successive functions in *SYSTEM-LOADER-HOOKS* using <NAME>, the list of keywords, and :ALLOW-OTHER-KEYS T until one returns true, and signals an error if no function in *SYSTEM-LOADER-HOOKS* returns true. *SYSTEM-LOADER-HOOKS* [Function] A list of designators for functions that take a string designator and a list of keywords. When called, each function will attempt to load a system identified by the string designator and possibly some of the keyword arguments. -- So, for example, ASDF could install a hook for each of the two variables that called OPERATE with suitable arguments, and other defsystems could do analogous things. Library management tools like asdf-install could indirect through BUILD-SYSTEM and LOAD-SYSTEM. Inter-system dependencies could translate into to calls to LOAD-SYSTEM (possibly after trying a defsystem-specific mechanism like what ASDF does now). Since both of these functions takes keywords, things like system versions or arguments to the construction or loading machinery can be supplied and their interpretation is left to an underlying defsystem tool. Thoughts? -- Richard ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/