From: Marco Antoniotti
Subject: getenv in various COMMON LISPs
Date: 
Message-ID: <lw67ltb5li.fsf@galvani.parades.rm.cnr.it>
Hi,

I would like to write a function with signature

	get-environment-variable env-var-name ==> env-var-value

ENV-VAR-NAME is either a string or a symbol ('symbol-name' will be
used on it in this case) and ENV-VAR-VALUE is a string.  I.e. I want
'getenv'.  ENV-VAR-VALUE contains a string which is the value of the
environment variable.  No extra manipulations desired and/or
requested.

At the moment I have only access to CMULISP on a Solaris platform and I
would like to get this function for various implementations.  More
specifically

ACL
LispWorks
MCL
Clisp

Please send me a copy of the function and I will post the results.

Thanks

-- 
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - (0)6 - 68 80 79 23, fax. +39 - (0)6 - 68 80 79 26
http://www.parades.rm.cnr.it

From: Phil Stubblefield
Subject: Re: getenv in various COMMON LISPs
Date: 
Message-ID: <34FED905.5380019B@rpal.rockwell.com>
Marco Antoniotti wrote:
> 
> Hi,
> 
> I would like to write a function with signature
> 
>         get-environment-variable env-var-name ==> env-var-value
> 
> ENV-VAR-NAME is either a string or a symbol ('symbol-name' will be
> used on it in this case) and ENV-VAR-VALUE is a string.  I.e. I want
> 'getenv'.  ENV-VAR-VALUE contains a string which is the value of the
> environment variable.  No extra manipulations desired and/or
> requested.
> 
> At the moment I have only access to CMULISP on a Solaris platform and I
> would like to get this function for various implementations.  More
> specifically
> 
> ACL
> LispWorks
> MCL
> Clisp
> 
> Please send me a copy of the function and I will post the results.
> 
> Thanks
> 
> --
> Marco Antoniotti ===========================================
> PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
> tel. +39 - (0)6 - 68 80 79 23, fax. +39 - (0)6 - 68 80 79 26
> http://www.parades.rm.cnr.it

I don't know what the MacOS equivalent of an environment variable
would be; I'm not sure there is one.

In any case, here's a function I found in some old code:

(defun getenv (name)
  "Returns the value of the named environment variable, or NIL."
  #+Allegro   (sys:getenv name)
  #+Lucid     (lcl:environment-variable name)
  #+LispWorks (sys::getenv name)
  #-(or Allegro Lucid LispWorks)
  (declare (ignore name))
  #-(or Allegro Lucid LispWorks)
  (error "GETENV is not defined for this Lisp implementation."))

Good luck!


Phil Stubblefield
Rockwell Palo Alto Laboratory                               650/325-7165
http://www.rpal.rockwell.com/~phil                ····@rpal.rockwell.com
From: Francis Leboutte
Subject: Re: getenv in various COMMON LISPs
Date: 
Message-ID: <35032daa.36684509@news.skynet.be>
Phil Stubblefield <····@rpal.rockwell.com> wrote:

>Marco Antoniotti wrote:
>> 
 ....
>(defun getenv (name)
>  "Returns the value of the named environment variable, or NIL."
>  #+Allegro   (sys:getenv name)
>  #+Lucid     (lcl:environment-variable name)
> ...

For ACL4W you could add:
#+ACLPC
(allegro:getenv name)

Name must be a string.

Francis


--
Francis Leboutte
··········@skynet.be ········@acm.org  http://users.skynet.be/algo
Marre du courrier non sollicit� (spam)? Visitez http://www.cauce.org
From: ·······@magma.ca
Subject: Re: getenv in various COMMON LISPs
Date: 
Message-ID: <6dp1s4$le8$1@nnrp1.dejanews.com>
In article <·················@rpal.rockwell.com>,
  Phil Stubblefield <····@rpal.rockwell.com> wrote:
> I don't know what the MacOS equivalent of an environment variable
> would be; I'm not sure there is one.
>
> In any case, here's a function I found in some old code:
>
> (defun getenv (name)
>   "Returns the value of the named environment variable, or NIL."
>   #+Allegro   (sys:getenv name)
>   #+Lucid     (lcl:environment-variable name)
>   #+LispWorks (sys::getenv name)

    #+clisp     (system::getenv name)

    ;; ...

--Vassili

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading
From: Joerg Hoehle
Subject: Re: getenv in various COMMON LISPs
Date: 
Message-ID: <6euo0d$dm0@omega.gmd.de>
Marco Antoniotti (·······@galvani.parades.rm.cnr.it) wrote:
: #+:CLISP
: (sys::getenv <name string>)				; maybe setf'able

: The only doubts I still have regard the "setf'able" status of CLISP

CLISP's sys::getenv is not setf'able, and to quote Bruno Haible:
BH>You can't, because you can't do it portably. Having sys::getenv
BH>setfable would make the functions EXECUTE and MAKE-PIPE-*-STREAM
BH>more complicated (if doable at all) on DOS, OS/2, RISC/OS and AmigaOS.

	Jo"rg Ho"hle.
············@gmd.de		http://zeus.gmd.de/~hoehle/amiga-clisp.html