Proposal: Add setEnv/unsetEnv to "base"

Duncan Coutts duncan.coutts at googlemail.com
Wed Oct 3 20:26:55 CEST 2012


On 3 October 2012 19:14, Simon Hengel <sol at typeful.net> wrote:
> Hi,
> setting environment variables is possible on both POSIX and Windows
> systems.  Currently this functionally is missing from
> System.Environment; the "unix" package provides an implementation for
> POSIX systems.
>
> I propose to add setEnv/unsetEnv to System.Environment, so that it is
> easier to write applications that behave the same on POSIX and Windows
> systems.

Sounds fine to me. The API is fine: it's the right module, the new
names match the existing ones (getEnv). I've not looked at the
implementation very closely.

> I implemented both in a way, so that they behave exactly the same on
> POSIX and Windows (modulo case sensitivity on Windows).

Ok, good.

> For now I prepared a standalone implementation [1] and corresponding
> tests [2].  That implementation depends on the "unix" package.  If the
> proposal is accepted, I will prepare a patch against "base" that
> includes the relevant code from "unix".

Seems reasonable.

Duncan



More information about the Libraries mailing list