annotate 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
rev   line source
lindquist@33 1 module foreach1;
lindquist@33 2 import std.stdio;
lindquist@33 3
lindquist@33 4 void main()
lindquist@33 5 {
lindquist@33 6 static arr = [1,2,3,4,5];
lindquist@33 7
lindquist@33 8 writef("forward");
lindquist@33 9 foreach(v;arr) {
lindquist@33 10 writef(' ',v);
lindquist@33 11 }
lindquist@33 12 writef("\nreverse");
lindquist@33 13 foreach_reverse(v;arr) {
lindquist@33 14 writef(' ',v);
lindquist@33 15 }
lindquist@33 16 writef("\n");
lindquist@33 17 }