Mercurial > projects > ldc
comparison test/arrays4.d @ 40:8b0e809563df trunk
[svn r44] Lots of bug fixes.
New array literal support
New array ~= operator support (for single element)
New with statement support
More...
author | lindquist |
---|---|
date | Fri, 19 Oct 2007 07:43:21 +0200 |
parents | 77cdca8c210f |
children | c44e6a711885 |
comparison
equal
deleted
inserted
replaced
39:fd5e8bbfcb25 | 40:8b0e809563df |
---|---|
1 module arrays4; | 1 module arrays4; |
2 | 2 import std.stdio; |
3 void main() | 3 void main() |
4 { | 4 { |
5 auto arr = new int[4]; | 5 int[] arr; |
6 auto arrcat = arr ~ arr; | 6 arr ~= 3; |
7 assert(arrcat.length == arr.length * 2); | 7 assert(arr.length == 1); |
8 assert(arr[0] == 3); | |
9 arr ~= 5; | |
10 assert(arr.length == 2); | |
11 assert(arr[0] == 3); | |
12 assert(arr[1] == 5); | |
13 writefln(arr); | |
8 } | 14 } |
9 |