This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: require vs use-modules


Ian Bicking <ian@bickiia.earlhall.earlham.edu> writes:

> Couldn't we just implement something so that:
> 
> (use-modules (slib pp))
> ; or, currently: (use-modules (ice-9 slib pp))  ?
> 
> is the same as:
> 
> (require 'pp)
> 
> Or is there a deeper structure to the modules that would make this
> hack inconsistent with the rest of the module system?

It *is* possible to define

  (require 'pp)

to mean

  (use-modules (slib pp))

and let the latter autoload pp.scm from the slib library into the
(slib pp) module.

For (require "xxx") it is possible to do some magic corresponding to
the above.

> Maybe it's just something waiting for the new module system to fix
> it and it's already planned to make it disappear then.

Yes, since we anyway have to change these things when the new module
system comes, I'm reluctant do implement the above now.  But if anyone
is interested in doing this I could try to give some advice.

Another thing we should perhaps do is to implement an SCM
compatibility module:

  (use-modules (compat SCM))

should make it possible to run SCM programs without much further ado.

/mdj