June 15, 2005 Re: foreach | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rodolfo Borges | Rodolfo Borges napsal(a):
> http://www.digitalmars.com/d/statement.html#foreach
>
> says:
> ForeachStatement:
> foreach (ForeachTypeList; Expression) Statement
>
> //shouldn't it allow:
> foreach(int i; [ 1, 2, 3, 4 ]) {
> }
>
> //not pretty to force me write:
> static int[] dummy = [ 1, 2, 3, 4 ];
> foreach(int i; dummy) {
> }
>
>
you can use Python for this feature ;)
|
Copyright © 1999-2021 by the D Language Foundation