From ... From: Erik Naggum Subject: Re: Environment variables? (Unix) Date: 1995/04/28 Message-ID: <19950428T113646Z.enag@naggum.no>#1/1 X-Deja-AN: 101759220 references: <3nphgo$ha8@kadath.zeitgeist.net> organization: Naggum Software; +47 2295 0313 newsgroups: comp.lang.lisp [Peter Seibel] | Is it possible to access Unix environment variables in Common Lisp. only on Unix implementations. | I looked through CLtL2 and couldn't quite find anything that made it | clear to me. system-dependent issues wouldn't be described in CLtL2. | If so how does one access them. well, first you need find the function. (apropos "getenv") would be a start. (list-all-packages) will list all packages, and you may be able to focus apropos printout if you limit it to a particular package, as in (apropos "environment" :extensions). unfortunately, the three Lisps that I just tested on have not agreed on how to do it. here's a unified version (defun get-environment-variable (var) "Return the value of environment variable VAR, or NIL if none." (declare (string var)) (prog1 #+(and :unix :cmu17) (cdr (assoc (intern var :keyword) *environment-list*)) #+(and :unix :kcl) (system:getenv var) ;also AKCL, GCL #+(and :unix :clisp) (system::getenv var) nil)) can others add to this for their implementation? it would be nice to have a fully portable function among Unix systems. # -- sufficiently advanced political correctness is indistinguishable from sarcasm