Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Common Lisp: *require-hooks*

108 views
Skip to first unread message

avodo...@gmail.com

unread,
Aug 8, 2012, 6:01:29 PM8/8/12
to
Why CL:REQUIRE is deprecated?

Would it be a good if Common Lisp provided some *REQUIRE-HOOKS*
variable - a list of functions. Every function in this list
is given a chance to load the module when user invokes (REQUIRE "module").

So if I want to integrate require with ASDF I say:
(push (lambda (module)
(asdf:operate 'asdf:load-op module)
(provide module))
cl:*require-hooks*)

If I want to integration REQUIRE with quicklisp:
(push (lambda (module)
(ql:quickload module)
(provide module))
cl:*require-hooks*)

Jean-Claude Beaudoin

unread,
Aug 8, 2012, 6:31:16 PM8/8/12
to
Why don't you have a look at asdf.lisp in the ASDF git repository
around line 4460 and tell us what you think! :-)

avodo...@gmail.com

unread,
Aug 8, 2012, 6:48:16 PM8/8/12
to
> Why don't you have a look at asdf.lisp in the ASDF git repository
> around line 4460 and tell us what you think! :-)

Ah, most of Lisp have *module-provider-functions* for that purpose.
Good.

Could anyone explain why require is deprecated? What's wrong with it?

avodo...@gmail.com

unread,
Aug 8, 2012, 6:53:26 PM8/8/12
to
I also think that maybe *module-provider-functions* deserves a CDR..

Pascal J. Bourguignon

unread,
Aug 8, 2012, 7:37:22 PM8/8/12
to
What's wrong is that when used with a single argument, it's behavior is
implementation dependant.

When you use (LOAD path), you know exactly what happens. When you use
(REQUIRE string), anything can happen.

That's why more sophisticated facilities like ASDF or QUICKLISP are
built upon LOAD, not upon REQUIRE.

Implementation dependent features are the scourge of the CL programmer!
;-)

--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.

Ugih Li

unread,
Aug 8, 2012, 9:17:34 PM8/8/12
to
In ASDF if I have to specify :depends-on xxxx, I'd better use load 1.lisp load 2.lisp ...in right order in a single file instead of using asdf.

Zach Beane

unread,
Aug 8, 2012, 9:46:11 PM8/8/12
to
Ugih Li <fre...@gmail.com> writes:

> In ASDF if I have to specify :depends-on xxxx, I'd better use load
> 1.lisp load 2.lisp ...in right order in a single file instead of using
> asdf.

You can get a similar effect by using the ":serial t" option in the
system definition.

Zach
0 new messages