associative arrays

dennis luehring dl.soluz at gmx.net
Mon Jan 9 05:25:57 PST 2012


> assert(key in aa);
> aa.remove(key);
>
> So, as far as I can tell, the current situation is more efficient, and it
> doesn't cost you any expressiveness. You can still have an exception thrown
> when remove fails if you use enforce before the call if you want an exception
> thrown when the element isn't there.

but then it should be called optional_remove - because it "mabye" removes

its like file_delete, DeleteFile (and all the others) on non existing 
files - why is there an exception/error neeeded if missing?

the "maybe"-situation is not that often used in good code - because you 
can't find your errors if many routines would work like remove



More information about the Digitalmars-d-learn mailing list