Re: [cl-cookbook-contrib] getenv
Brought to you by:
jthing
From: Nick L. <nd...@ra...> - 2004-10-11 16:57:41
|
> in the cl-cookbook: > > (defun my-getenv (name &optional default) > #+CMU > (let ((x (assoc name ext:*environment-list* > :test #'string=))) > (if x (cdr x) default)) > #-CMU > (or > #+Allegro (sys:getenv name) > #+CLISP (ext:getenv name) > #+ECL (si:getenv name) > #+SBCL (sb-unix::posix-getenv name) > #+LISPWORKS (lispworks:environment-variable name) > default)) Yes, but I think the cookbook version does its job. But the cookbook verson is wrong. It doesn't distinguish between implementation-not-found and env-var-not-found. - nick |