Mercurial > projects > dstress
comparison run/mini/foreach1.d @ 1628:c6ef09dfba4d
add mini test set from ldc project
author | Moritz Warning <moritzwarning@web.de> |
---|---|
date | Mon, 10 Jan 2011 19:47:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1627:e1b954780837 | 1628:c6ef09dfba4d |
---|---|
1 module foreach1; | |
2 extern(C) int printf(char*, ...); | |
3 | |
4 void main() | |
5 { | |
6 static arr = [1,2,3,4,5]; | |
7 | |
8 printf("forward"); | |
9 foreach(v;arr) { | |
10 printf(" %d",v); | |
11 } | |
12 printf("\nreverse"); | |
13 foreach_reverse(v;arr) { | |
14 printf(" %d",v); | |
15 } | |
16 printf("\n"); | |
17 } |