On Thu, Dec 31, 2009 at 12:42 PM, Olsen, Peter C. Peter.Olsen@jhuapl.edu wrote:
Ladies and Gentlemen,
I've come to the point where it would be convenient for me to establish a system-wide run-time configuration so that every invocation of ABCL for every user starts with a few common packages. The only way I can find to do that is to have everyone put the appropriate code in their .abclrc files. I've tried to put a load command in the shell script that starts the interpreter, but it doesn't work.
/usr/bin/java -classpath abcl.jar:jscheme.jar org.armedbear.lisp.Main "(load "invoke.lisp")" $@
...Main --load invoke.lisp
I suggest that we consider changing the processInitializationFile method in Interpreter.java to look for some sort of initialization file in the directory in which abcl.jar is located when the Interpreter starts. That seems to be a simple change.
It's not always easy to determine the "directory" where abcl.jar resides. The jar could be inside a .war archive deployed in an application server, or downloaded from some URL, e.g. by an applet or Java WebStart application (actually abcl out of the box doesn't work in this latter scenario, but I have a simple patch to make it work).
A more elegant solution would be add some code to determine the OS and then look for configuration files in an appropriate place for each one.
I believe a common approach to this problem in Java is to place the configuration file(s) in a known location inside the classpath. Then, you launch the application with -cp whatever:/etc/myapp/conf or -cp whatever;C:\myapp\conf depending on the OS, and have the application find the file using a fixed path, say, /config.lisp.
I'm a newbie to this project, so I don't want to overstep my bounds. Having said that, I'd be happy to make and test the changes I've proposed.
Comments (particularly on the OS variation)?
Thanks!
Peter
Peter Olsen, P.E., Ae.E. Registered Professional Engineer, Maryland License 12283 The Johns Hopkins University Applied Physics Laboratory 11100 Johns Hopkins Road, M/S 17-214 Laurel, Maryland, 20723 Baltimore: 443-778-2577; Washington DC 240-228-2577
Heterogeneity is inevitable and must be supported by design. (RFC 1958)
armedbear-devel mailing list armedbear-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel