On Tue, 17 Jan 2012 19:02:03 -0500, Nick Sabalausky <[email protected]> wrote:

"Alvaro" <[email protected]> wrote in message


Oops. Yes, thanks.

So, not bad. In those [infrequent, I'd say] cases needing an array one
would do:

 auto keys = array(aa.keys);


My thoughts exactly. The current .keys made sense back in the days before
ranges, std.algorithm, etc, but not so much anymore. Vote++

There is one significant problem with changing aa.keys to be a lazy range instead of an array. This is valid code (and does exist in the wild):

foreach(k; aa.keys)
{
   if(shouldRemove(k))
      aa.remove(k);
}

This would silently start crashing programs if we changed the behavior of keys.

I don't see any way around this...

-Steve

Reply via email to