From seth at tewebs.com Fri Aug 14 18:11:37 2009 From: seth at tewebs.com (Seth) Date: Fri, 14 Aug 2009 13:11:37 -0500 Subject: [trivial-shell-devel] Request to Add Following : setenv and getenv Message-ID: <200908141811.n7EIBcCE008688@smtp-webmail.ivenue.com> Setting Environment Variables. Notice that its envget instead of getenv because lispworks already has such a exported symbol (defun envget (var &optional (nullret "")) (let ((env #+clisp (ext:getenv (if (equalp var "") " " var)) #+sbcl (sb-posix:getenv var) #+ecl (si:getenv var) #+allegro (sys:getenv var) #+lispworks (lw:environment-variable var) #-(or clisp sbcl ecl allegro lispworks) (error "GETENV is not supported for your implementation"))) #+clisp (if (equalp env "") nullret env) #+(or sbcl allegro lispworks ecl) (if (null env) nullret env))) (defun envset (var content) (let ((it #+clisp (setf (ext:getenv var) content) #+sbcl (sb-posix:putenv (concatenate 'string var "=" content)) #+ecl (si:setenv var content) #+allegro (setf (sys:getenv var) content) #+lispworks (setf (lw:environment-variable var) content) #-(or clisp sbcl ecl allegro lispworks) (error "SETENV is not supported for your implementation"))) #+sbcl (if (= it 0) content nil) #+(or lispworks clisp allegro ecl) (if it content))) (defun (setf envget) (var content) (setenv var content)) ---- Msg sent via WebMail From sky at viridian-project.de Fri Aug 14 19:34:39 2009 From: sky at viridian-project.de (Leslie P. Polzer) Date: Fri, 14 Aug 2009 21:34:39 +0200 (CEST) Subject: [trivial-shell-devel] Request to Add Following : setenv and getenv In-Reply-To: <200908141811.n7EIBcCE008688@smtp-webmail.ivenue.com> References: <200908141811.n7EIBcCE008688@smtp-webmail.ivenue.com> Message-ID: Seth wrote: > Setting Environment Variables. Notice that its envget instead of getenv because > lispworks already has > such a exported symbol OSICAT already offers #'environment and #'(setf environment-variable). FWIW. Leslie -- http://www.linkedin.com/in/polzer From gwking at metabang.com Tue Aug 18 21:24:45 2009 From: gwking at metabang.com (Gary King) Date: Tue, 18 Aug 2009 17:24:45 -0400 Subject: [trivial-shell-devel] Request to Add Following : setenv and getenv In-Reply-To: <200908141811.n7EIBcCE008688@smtp-webmail.ivenue.com> References: <200908141811.n7EIBcCE008688@smtp-webmail.ivenue.com> Message-ID: <453DBF64-1EF9-4440-8450-AA99B158E730@metabang.com> Hi Seth, FWIW, trivial-shell already has `get-env-var`. It doesn't have set-env- var though so I'll add that. (or, probably, (setf get-env-var). Maybe I'll even rename things to lose the abbreviations: get-environment- variable! thanks, On Aug 14, 2009, at 2:11 PM, Seth wrote: > Setting Environment Variables. Notice that its envget instead of > getenv because > lispworks already has > such a exported symbol > > (defun envget (var &optional (nullret "")) > (let ((env #+clisp (ext:getenv (if (equalp var "") " " var)) > #+sbcl (sb-posix:getenv var) > #+ecl (si:getenv var) > #+allegro (sys:getenv var) > #+lispworks (lw:environment-variable var) > #-(or clisp sbcl ecl allegro lispworks) (error "GETENV > is not > supported for your implementation"))) > #+clisp (if (equalp env "") nullret env) > #+(or sbcl allegro lispworks ecl) (if (null env) nullret env))) > > (defun envset (var content) > (let > ((it #+clisp (setf (ext:getenv var) content) > #+sbcl (sb-posix:putenv (concatenate 'string var "=" content)) > #+ecl (si:setenv var content) > #+allegro (setf (sys:getenv var) content) > #+lispworks (setf (lw:environment-variable var) content) > #-(or clisp sbcl ecl allegro lispworks) > (error "SETENV is not supported for your implementation"))) > #+sbcl (if (= it 0) content nil) > #+(or lispworks clisp allegro ecl) (if it content))) > > (defun (setf envget) (var content) > (setenv var content)) > > > ---- Msg sent via WebMail > > _______________________________________________ > trivial-shell-devel mailing list > trivial-shell-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/trivial-shell-devel -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM * gwking on twitter