Thread: [cl-cookbook-contrib] getenv
Brought to you by:
jthing
From: Heow Eide-G. <li...@al...> - 2004-10-11 01:54:41
|
Guys, I noticed that the CLOCC ports collection also has a getenv defined as is also in the cl-cookbook. in CLOCC Ports or cl-ports of Debian, sys.lisp: (defun getenv (var) "Return the value of the environment variable." #+allegro (sys::getenv (string var)) #+clisp (sys::getenv (string var)) #+cmu (cdr (assoc (string var) ext:*environment-list* :test #'equalp :key #'string)) #+gcl (si:getenv (string var)) #+lispworks (lw:environment-variable (string var)) #+lucid (lcl:environment-variable (string var)) #+mcl (ccl::getenv var) #+sbcl (sb-ext:posix-getenv var) #-(or allegro clisp cmu gcl lispworks lucid mcl sbcl) (error 'not-implemented :proc (list 'getenv var))) 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)) - Heow |
From: Edi W. <ed...@ag...> - 2004-10-11 15:14:59
|
On 10 Oct 2004 21:49:46 -0400, Heow Eide-Goodman <li...@al...> wrote: > Guys, > > I noticed that the CLOCC ports collection also has a getenv defined as > is also in the cl-cookbook. > > in CLOCC Ports or cl-ports of Debian, sys.lisp: > > (defun getenv (var) > "Return the value of the environment variable." > #+allegro (sys::getenv (string var)) > #+clisp (sys::getenv (string var)) > #+cmu (cdr (assoc (string var) ext:*environment-list* :test #'equalp > :key #'string)) > #+gcl (si:getenv (string var)) > #+lispworks (lw:environment-variable (string var)) > #+lucid (lcl:environment-variable (string var)) > #+mcl (ccl::getenv var) > #+sbcl (sb-ext:posix-getenv var) > #-(or allegro clisp cmu gcl lispworks lucid mcl sbcl) > (error 'not-implemented :proc (list 'getenv var))) > > > 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. Its main job, IMHO, is to give "newbies" an idea about where to look for similar stuff. IIRC CLOCC is GPL so I'm not even sure if we're allowed to integrate CLOCC code into the cookbook without changing our license. IANAL. Cheers, Edo. |
From: Sam S. <sd...@gn...> - 2004-10-11 16:41:41
|
> * Edi Weitz <rqv@ntunegn.qr> [2004-10-11 17:16:00 +0200]: > > IIRC CLOCC is GPL so I'm not even sure if we're allowed to integrate > CLOCC code into the cookbook without changing our license. IANAL. CLOCC/PORT is LLGPL. -- Sam Steingold (http://www.podval.org/~sds) running w2k <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.honestreporting.com> I don't want to be young again, I just don't want to get any older. |
From: Edi W. <ed...@ag...> - 2004-10-11 17:19:16
|
On Mon, 11 Oct 2004 12:28:53 -0400, Sam Steingold <sd...@gn...> wrote: >> * Edi Weitz <rqv@ntunegn.qr> [2004-10-11 17:16:00 +0200]: That's not my email address... > CLOCC/PORT is LLGPL. So it would be OK to just include the CLOCC code for getenv in the cookbook (with proper attribution, of course)? Cheers, Edi. |
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 |
From: Sam S. <sd...@gn...> - 2004-10-11 17:53:05
|
> * Edi Weitz <rqv@ntunegn.qr> [2004-10-11 19:19:25 +0200]: > On Mon, 11 Oct 2004 12:28:53 -0400, Sam Steingold <sd...@gn...> wrote: >>> * Edi Weitz <rqv@ntunegn.qr> [2004-10-11 17:16:00 +0200]: > That's not my email address... some people object to plain text e-mail addresses in message bodies, so I use rot13. >> CLOCC/PORT is LLGPL. > > So it would be OK to just include the CLOCC code for getenv in the > cookbook CLOCC/PORT, yes. CLOCC/CLLIB is GPL. other parts of CLOCC may be covered by different licenses (MIT, BSD, PD &c) > (with proper attribution, of course)? and proper license. e.g., if cookbook is GPL, you can include as is, but if it is BSD or PD, you have to specify that certain parts (specifically, CLOCC/PORT) are covered by a different license (specifically, LLGPL). -- Sam Steingold (http://www.podval.org/~sds) running w2k <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.honestreporting.com> You think Oedipus had a problem -- Adam was Eve's mother. |
From: Heow Eide-G. <li...@al...> - 2004-10-11 20:02:24
|
An interesting note on the LGPL on common-lisp.net: What's wrong with LGPL? Nothing per se, but it probably does not mean what you think it means. The highly C-centric point of view of the LGPL makes a distinction between static and dynamic linking, but tells us very little about certain issues that are of paramount importance for Lisp users: * Is loading LGPL code into a non-LGPL image ok? (runtime dependency) * Is it ok to use LGPL macros in non-LGPL code? (compile-time dependency) * Is it ok to redefine operators provided by the LGPL code in non-LGPL code? * Is it ok to distribute an image with LGPL code loaded? Whether or not these questions are answerable within the bounds of the LGPL is a matter of debate, but given that the interpretation is not clear we do not recommend using the LGPL license for Common-lisp.net projects. If you want to disallow all of the above use GPL, and if you want to allow some or all of them use LLPGL or MIT/BSD/X11 style licenses. |