Timon Gehr:

http://wiki.dlang.org/DIP57

With these semantics, tuple foreach, eg:

void main(){
    foreach(x;Seq!(1,2)){ ... }
}

is equivalent to static foreach with an additional pair of curly brackets, eg:

void main(){
    static foreach(x;Seq!(1,2)){ { ... } }
}

Having three kinds of foreach in a language is too much. So I suggest to add to DIP57 one more thing: that the introduction of static foreach should come with a warning against the usage of not-static foreach on tuples (and eventually this warning should become a deprecation message).

Bye,
bearophile

Reply via email to