Mercurial > projects > ldc
comparison test/foreach1.d @ 33:bc641b23a714 trunk
[svn r37] * Initial support for foreach on static arrays. Not 100% complete
author | lindquist |
---|---|
date | Thu, 04 Oct 2007 22:38:53 +0200 |
parents | |
children | d9d5d59873d8 |
comparison
equal
deleted
inserted
replaced
32:a86fe7496b58 | 33:bc641b23a714 |
---|---|
1 module foreach1; | |
2 import std.stdio; | |
3 | |
4 void main() | |
5 { | |
6 static arr = [1,2,3,4,5]; | |
7 | |
8 writef("forward"); | |
9 foreach(v;arr) { | |
10 writef(' ',v); | |
11 } | |
12 writef("\nreverse"); | |
13 foreach_reverse(v;arr) { | |
14 writef(' ',v); | |
15 } | |
16 writef("\n"); | |
17 } |