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: naming modules



jostobfe@calvados.zrz.tu-berlin.de writes:
> 
> > (import-module "/usr/src/math.scm" as "special-math")
> 
> Or (usr src math) if you want namelists. 
> 

That doesn't really help.

> 
> > Actually, this in effect guarantees uniqueness by naming the module
> > according to its full path in the filesystem. I don't think that is a
> > good plan, it would make it impossible to write code that works on
> > more than one system this way.
> 
> Umm, could you explain this?
> 

If you ship a package that depends on both of those math.scm's and
resolves things the way you had, people would have to install one
math.scm in /usr/src and the other in whatever the other directory
was. I don't think this is acceptable, for instance, I use machines
regularly where I do not have write permissions to /usr/src but I
still like to install software on them. Hence, finding modules in a
directory related to Guile's $prefix makes much more sense, at which
point you can drop the (usr src ...) bit, at which point you are back
to the original problem of making sure the namespace stays
unique. Note that filenames in the module namespace don't have to stay
unique, just module names, which are hierarchical.

 - Maciej