[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #1270: process procedures should expect their env par
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #1270: process procedures should expect their env parameter in the same format get-environment-variables uses |
Date: |
Wed, 16 Mar 2016 14:47:14 -0000 |
#1270: process procedures should expect their env parameter in the same format
get-environment-variables uses
-------------------------------+--------------------
Reporter: ckeen | Owner:
Type: change request | Status: new
Priority: not urgent at all | Milestone: 5.0
Component: core libraries | Version: 4.10.x
Keywords: |
-------------------------------+--------------------
The current posix unit uses alists in get-environment-variables but
expects lists of strings ("VAR=VAL" "VAR2"="VAL2") as the environment
variable.
The reason for this is that they will get handed through to the libc's
execve function.
My proposal is to change this behaviour to take alists as these are easier
to handle in scheme and feel more natural.
Currently every user program needs to do this on its own, for example:
{{{
(define (update-environment updates)
(let ((env (get-environment-variables)))
(map
(lambda (e)
(string-append (car e) "=" (cdr e)))
(fold (lambda (u env)
(alist-update (car u) (cdr u) env equal?))
env updates))))
}}}
Potentially this will break a lot of code, therefore I propose this for
CHICKEN 5.
--
Ticket URL: <http://bugs.call-cc.org/ticket/1270>
CHICKEN Scheme <http://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Chicken-janitors] #1270: process procedures should expect their env parameter in the same format get-environment-variables uses,
Chicken Trac <=