Begin forwarded message:
From: Marc Feeley feeley@iro.umontreal.ca Date: May 5, 2006 10:43:06 PM GMT+02:00 To: Eric Merritt cyberlync@gmail.com Subject: Re: [gambit-list] Path for ##include
On 5-May-06, at 10:30 PM, Eric Merritt wrote:
Is there a way to specify a set of directories that ##include will use to find files. After rooting around in the sources for an hour or so I was unable to find anything. I have been trying various project/library layouts and have happened across a couple that should work well. However, they won't work if all of there dependent headers must be in the same directory as the source or the gambit install directory.
Do you have any suggestions? I am currently implementing a "require" form, which has the concept of modules and I'm pondering what would be the best way to locate the modules. I dislike search paths (because the meaning of a program will depend on an environment variable, which seems insecure), but maybe there is no better way.
Marc
Afficher les réponses par date
see below.
On 5/5/06, Marc Feeley feeley@iro.umontreal.ca wrote:
On 5-May-06, at 10:30 PM, Eric Merritt wrote:
Is there a way to specify a set of directories that ##include will use to find files. After rooting around in the sources for an hour or so I was unable to find anything. I have been trying various project/library layouts and have happened across a couple that should work well. However, they won't work if all of there dependent headers must be in the same directory as the source or the gambit install directory.
Do you have any suggestions? I am currently implementing a "require" form, which has the concept of modules and I'm pondering what would be the best way to locate the modules. I dislike search paths (because the meaning of a program will depend on an environment variable, which seems insecure), but maybe there is no better way.
Marc
I think you have two choices convention or configuration (as the rails guys would say). Convention would indicate that you assume a location for libraries and then assume a default directory structure for that library. For example,
Gambit Home Dir |- site-scheme |- my-library |- include (*#.scm headers go here) |- src |- docs |- loadable-binaries |- x86 |- x86-64 |- etc ... |- info.scm
Then you could just do a (require 'my-library) and everything works. It would also make a future 'apt-get' like system much simpler to implement. Hell, if you assumed a documentation layout you could probably implement something 'apropos'-esque. Of course, you would want to set up the directory layout in accordance with whatever module system you have in mind.
Configuration would indicate that you accept a list of paths from somewhere. I think that the best way to go in this regard is command line parameters that initialize some modifiable path variable in gambit. This would allow build systems to pass what the want in on the command line and, if required, code could modify that variable as needed. I am not a big fan of environmental variables so I lean towards the command line option.
Personally, I like a combination of the two. In this scenario gambit would assume a directory structure/layout for libraries but the location of 'site-scheme' would be configurable in the manner described in Configuration. This imposes a rigorousness and consistency on libraries that I like but my tastes aren't generally mainstream.
I think at the very least you need the configuration option but I would be happy with any of these approaches.