On Tue, Feb 24, 2009 at 8:23 PM, Daniel Keep
<[email protected]> wrote:

> Yup.
>
> It's a pity that we don't have, oh I don't know, some sort of efficient
> iterable interface that doesn't cause a heap allocation that the runtime
> could use instead *cough*hint*cough*andrei*cough*ranges*cough*.

You can use "foreach(k; aa)" and "foreach(_, v; aa)".

The thing is they're not always substitutes for .keys and .values.
For example, if you want to modify the AA during the foreach loop, you
have to use something like "foreach(k; aa.keys)" since you need a
"snapshot" of the keys as they were before you started modifying it.

Reply via email to