Autoloading

Started by konrad, September 07, 2007, 04:44:21 AM

Previous topic - Next topic

konrad

One thing I have missed coming from python is the ability to have load find

modules for me, rather than having to know where they are on they are on the filesystem.



Writing somthing like this is easy. The question however is what should the searchpath be?



currently I'm using:





"."

"./modules"

"/home/USER/.newlisp/modules"

"/usr/local/share/newlisp/modules"

"/usr/share/newlisp/module"





is there any kind of general consensus on this. Along the same lines is there any sites which index and list the available newLisp modules, somthing along the lines of the kind of master repostories that Perl and Python have ?



PS the code I wrote is quite unix specific but I do plan to share it once I work out a good home for it, either google code or sourceforge would is likely at the moment.

Jeff

#1
You might want to write a function that determines the default newlisp directory based on the os environment, and then use that by itself and with /modules tacked on.  That would be more extensible.
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

konrad

#2
At the moment I have a Context with a paths symbol that evaluates to a list.

you are correct in that this symbol should be set based on the current platform.