[phobos] review for environment

Steve Schveighoffer schveiguy at yahoo.com
Wed Oct 27 20:05:53 PDT 2010





----- Original Message ----
> From: Andrei Alexandrescu <andrei at erdani.com>
> 
> Yah, I was referring to opAA.

With Posix, you have environment variables stored in a __gshared global.  
Providing a local range on that data isn't a good idea.  Windows provides the 
function GetEnvironmentStrings, which returns a memory block allocated to hold 
all the environment variables.  You must call FreeEnvironmentStrings to free the 
memory.

These are the only ways to iterate variables.  If you want individual variables 
for which you already know the names, there are functions for that, but Lars' 
code implements those through individual functions, not toAA.

The only way I could see it done better is to have a type that allows setting of 
the variables when you assign to the AA.  But you still need to copy the data.

-Steve



      


More information about the phobos mailing list