Revamping associative arrays
Piotrek
starpit at tlen.pl
Sun Oct 18 13:12:31 PDT 2009
Bill Baxter pisze:
> I think the default should be to iterate over whatever 'in' looks at.
>
I was almost convinced, because that rule has a sense. But treating
normal arrays and associative array has more sense to me.
fun (SomeObject object) {
foreach (element;object.arr1){ //normal, but how do I know at first look
//just do something with element
}
foreach (element;object.arr2){ // assoc, but how do I know at first look
//just do something with element hopefully not index
}
Cheers
Piotrek
More information about the Digitalmars-d
mailing list