The new std.process is ready for review

Vladimir Panteleev vladimir at thecybershadow.net
Wed Mar 13 01:15:33 PDT 2013


On Wednesday, 13 March 2013 at 06:31:57 UTC, Lars T. Kyllingstad 
wrote:
> That's a lot better than ["____":"_____"], at least. :)
>
> But still, the difference between a null AA and an empty AA is 
> still very subtle, and I am hesitant to design an API that 
> depends on it.  We'd have to explain to the users that "ok, so 
> there are two kinds of empty AAs: the ones you've done nothing 
> with, and the ones you've added and removed a value from..."
>
> Furthermore, the language spec doesn't seem to mention "null" 
> in relation to AAs.  Shouldn't the difference between null and 
> empty then be treated as an implementation detail?  Can we even 
> be sure that "aa is null" will work in two years?

It doesn't need to be part of the API. Just treat 
emptyEnvironment as a magic value that means to pass an empty 
environment. If the language's AA semantics change, the 
implementation can return an arbitrary AA literal from 
emptyEnvironment, and spawnProcess would do a "if (environment is 
emptyEnvironment)" check.

Making use of the current distinction between empty and null AAs 
is useful as it simplifies the implementation, and I think is 
marginally better than a magic (non-empty) value.


More information about the Digitalmars-d mailing list