diff options
author | Araq <rumpf_a@web.de> | 2014-02-03 19:03:40 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-02-03 19:03:40 +0100 |
commit | 96e616198d100f0e10337c0210b088730d66d91e (patch) | |
tree | d574f7c1cfd5103dc210e6ba3611290284a1dc34 /tests | |
parent | a2fce822dc08425fb25120749b9629d152a336a9 (diff) | |
parent | 866cfb9bb840d9fcace05fe49ad9f1c07e449406 (diff) | |
download | Nim-96e616198d100f0e10337c0210b088730d66d91e.tar.gz |
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Diffstat (limited to 'tests')
-rw-r--r-- | tests/parser/tcommand_as_expr.nim | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/parser/tcommand_as_expr.nim b/tests/parser/tcommand_as_expr.nim index a9747b0ac..22c49ab3f 100644 --- a/tests/parser/tcommand_as_expr.nim +++ b/tests/parser/tcommand_as_expr.nim @@ -1,9 +1,11 @@ discard """ output: '''140 -5-120''' +5-120-120 +359''' """ +#import math -proc optarg(x:int):int = x +proc optarg(x:int, y:int = 0):int = x + 3 * y proc singlearg(x:int):int = 20*x echo optarg 1, singlearg 2 @@ -13,5 +15,9 @@ proc foo(x, y: int): int = x-y let x = optarg foo 7.foo let y = singlearg foo(1, foo 8) +let z = singlearg 1.foo foo 8 + +echo x, y, z -echo x, y +let a = [2,4,8].map do (d:int) -> int: d + 1 +echo a[0], a[1], a[2] \ No newline at end of file |