Few things

Bruno Medeiros brunodomedeiros+spam at com.gmail
Thu Aug 2 03:15:47 PDT 2007


BCS wrote:
>> -------------------------
>>
>> 6) It can be useful a way to create an empty associative array with 
>> something like:
>> new int[char[]]();
>>
> 
> assigning null to an aa results in an empty aa, I'm not sure if it clear 
> other references to it though.
> 

Are you sure of that? It seems that at least for AA's, empty arrays are 
different than null arrays:

	int[char[]] b;		
	writefln(b is null); // true
	writefln(b == null); // true
	
	b["hello"] = 3;
	b.remove("hello");
	
	writefln(b); // empty AA
	writefln(b is null); // false
	writefln(b == null); // false (note this line in particular)

	b = null;
	writefln(b is null); // true
	writefln(b == null); // true

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list