[Ecls-list] Problem with environment access

Waldek Hebisch hebisch at math.uni.wroc.pl
Wed Jul 1 01:25:18 UTC 2009


The following program:

(defun |getEnv| (var-name)
   (si::getenv var-name)
)

(defun DaaseName (name)
  (let (daase filename)
   (declare (special $spadroot))
   (if (setq daase (|getEnv| "DAASE"))
    (progn
        (format *standard-output* "DAASE=~S~%" daase)
     (force-output *standard-output*)
     (setq filename  (concatenate 'string daase "/algebra/" name))
     (format t "   Using local database ~a.." filename))
    (progn
     (format *standard-output* "DAASE unset??? ~S~%" (|getEnv| "DAASE"))
     (force-output *standard-output*)
     (setq filename name)
     )
    )
   filename))

when compiled gives me unexpected result.  Namely, when DAASE variable
is set after:

(load (compile-file "tt3.lisp"))

I get:

> (DAASENAME "foo")
DAASE unset??? NIL
"foo"
> (|getEnv| "DAASE")

"zzz"

Apparently in the function DAASENAME we get different value
from (|getEnv| "DAASE") than in the repl.

-- 
                              Waldek Hebisch
hebisch at math.uni.wroc.pl 




More information about the ecl-devel mailing list