[ENH] Command-line argument access in the image

Helmut Grohne helmut at subdivi.de
Thu Dec 29 05:39:36 PST 2005


Hi Brian,

On Wed, Dec 28, 2005 at 10:22:30AM -0800, Brian Rice wrote:
> On Dec 28, 2005, at 8:12 AM, Jeff Sparkes wrote:
> >I think slate should use environment variables to find the image.
> >The debian package
> >has a shell script called slaterun which uses the enviroment variables
> >SLATE_IMAGE,
> >SLATE_LIB and SLATE_HOME.  SLATE_LIB points to the compiled plugins
> >and SLATE_HOME to the directory containing .slate files.  I'm not sure
> >that those are the best
> >names.  I'd probably build a "batteries included" image with
> >everything loaded to use for
> >writing scripts.  Similar to the clisp "base" and "full" startup  
> >options.

When first hitting file location problems my first idea was environment
variables, because it works out of the box without modifying the program
itself. It's also a common practise for other projects as well and works
well on different operating system including non-*nix. The best examples
are $PATH and perhaps $LD_LIBRARY_PATH for GNU systems. If you have good
ideas for better variable names, tell me and I'll perhaps change them if
you convice me. ;)

> Yeah, it'll be appropriate sometime soon to have varying standard- 
> built images, such as one with all data structures and bindings for  
> systems work, and one with the UI added onto that.

It might be possible to extend this approach. We could have one base
image and then some "image patches" to add up some functionality. The
difference to loading .slate files is that it should be much faster. The
result would be something like lisp's .fasl files or python's .pyc
files. This is just a quick idea. I like having a non-UI image, too. :)

> I'd like to avoid having to ask the user too much for a administrator  
> password to get that done, but there's also the ability to have ~/ 
> bin/ and ~/lib/ etc. in the path for the "make install" pattern using  
> the root as ~/.

That's a good approach. For *nix systems ~/(lib|bin)/ and
/usr/local/(lib|bin)/ should be ok (in this order). This has to be
changeable at compile time to support systems such as Debian that like
the stuff in /usr/(lib|bin)/. As mentioned above environment variables
should override these settings. This makes switching images much easier.

Helmut




More information about the Slate mailing list