Mercurial > projects > ldc
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/foreach1.d Thu Oct 04 22:38:53 2007 +0200 @@ -0,0 +1,17 @@ +module foreach1; +import std.stdio; + +void main() +{ + static arr = [1,2,3,4,5]; + + writef("forward"); + foreach(v;arr) { + writef(' ',v); + } + writef("\nreverse"); + foreach_reverse(v;arr) { + writef(' ',v); + } + writef("\n"); +}