"Pierre R. Mai" <[EMAIL PROTECTED]> writes: > John Klein <[EMAIL PROTECTED]> writes: > >> I have upgraded to 18d, and I am a bit baffled by require. >> What is the correct use of require? >> >> Before 18d, I would do (require 'foo) and >> cmucl would load "foo.x86f" in (ext:search-list "modules:") >> >> Now, 18d has changed it to try to load >> "foo-library.x86f" in (ext:search-list "modules:") >> >> But the CLHS says that my old usage is nonportable and that >> require is deprecated. >> Following the CLHS, should I define (ext:search-list "mylib:") and do >> (require "foo" "mylib:foo") to specify the explicit filename? >> >> So what the philosophically correct way to use `require', if I want >> to ensure compatibility with future cmucl revisions? >> Is `require' still meant to be used, given that it is deprecated? > > Personally I think that you are nearly always better off to either > create your own require-like mechanism, or to use one of the defsystem > utilities, which take care of compiling and loading code as needed.
This is more or less what I do with require. I make some stubs in uncompiled lisp files and stick them in the modules directory. I guess I should keep them in a separate place, but /I/ know which is which, and the system is only for teaching myself anyway. Here is how "modules:clocc-port-library.lisp" looks on my system: -- (load "clocc:src;port;port.system") (mk:oos "port" :load) -- The correct way would not need to load the system file, because my lisp would know where to find system files by itself, but I haven't looked that closely at defsystem, and I'm thinking of learning some other, newer facility anyways, so that keeps getting put off. The good thing about this indirect way of using require is that it is easier to do things like replacing clx with the clocc version of same, even if you don't keep clx in your dumped image. > > REQUIRE seriously only ever works halfway decently to load > implementation-supplied stuff (if that is the documented way to do > it), and even this usage is obviously implementation-dependent. Well, you have the clx thing again. What is implementation-supplied? > >> What was the reason for the -libraries change in 18d? > > The change was made in order to allow require to work as is to load > the implementation-supplied libraries, i.e. CLX, CLM, gray-streams, > etc. That might have been accomplished by changing the names of the fasl files, but I guess the new names would be confusing. (i.e. clx.fasl in the build-directory would not be the same as clx.fasl in the library). -- H�kon Alstadheim, hjemmepappa.
