[armedbear-devel] run-program :environment nil

Pascal J. Bourguignon pjb at informatimago.com
Mon Mar 26 16:12:39 UTC 2012


(lisp-implementation-version) --> "1.0.1"


The documentation of extensions:run-program is misleading:

    :environment 
        An alist of STRINGs (name . value) describing the new
        environment. The default is to copy the environment of the current
        process.

The alist doesn't describe the NEW environment, it is only MERGED into
the current environment.


Now of course, I consider the current behavior to be a bug:

    (text-stream-contents (extensions:process-output
                           (extensions:run-program "env" '()
                                                   :wait t :environment 'nil)))
    --> ("NNTPSERVER=news.individual.net" "ESHELL=/bin/bash"  …)


I would expect:

    (text-stream-contents (extensions:process-output
                           (extensions:run-program "env" '()
                                                   :wait t :environment 'nil)))
    --> ()

and:

    (text-stream-contents (extensions:process-output
                           (extensions:run-program "env" '()
                                                   :wait t :environment
                                                   '(("LC_CTYPE" . "C")))))
    --> ("LC_CTYPE=C"))

Which would match what the documentation says.



Also, in a shell environment, an empty variable is not the same as an
inexistant variable, so I cannot just loop over all the existing
variables to set them to an empty string.  I see no
SYSTEM::%PROCESS-BUILDER-ENV-REM function…


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.




More information about the armedbear-devel mailing list