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")" $@
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. 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'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
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
Hi Peter,
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")" $@
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. 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'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)?
As pointed out by Alessio, we may be in an environment where global access is not granted (such as Google App Engine) or where there is no real convention for centralized config files (such as Windows - which uses the registry, generally).
However, we seem to have one common location in all operating systems: our Jar file. What about loading custom statements added to the Jar if it contains an abclrc file?
Bye,
Erik.
Hi Peter,
On Fri, Jan 29, 2010 at 10:29 PM, Alan Ruttenberg alanruttenberg@gmail.com wrote:
However, we seem to have one common location in all operating systems: our Jar file. What about loading custom statements added to the Jar if it contains an abclrc file?
+1
It looks like others will enjoy the new feature too. If your offer to implement it still stands, I'm happy to help you out with any questions you may have. I'll be happy to commit the result to our source tree.
Bye,
Erik.
armedbear-devel@common-lisp.net