summary refs log tree commit diff stats
path: root/tests/parser/tcommand_as_expr.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-02-03 10:03:07 -0800
committerAndreas Rumpf <rumpf_a@web.de>2014-02-03 10:03:07 -0800
commit866cfb9bb840d9fcace05fe49ad9f1c07e449406 (patch)
tree53243d8ed7f1a8a4758267827e2218bad2c24200 /tests/parser/tcommand_as_expr.nim
parent7b3f95d8103738c16cbc2442a8eff68d343f5e7e (diff)
parent5bd3ec0bfb77a1a7342a183876e45c333b804345 (diff)
downloadNim-866cfb9bb840d9fcace05fe49ad9f1c07e449406.tar.gz
Merge pull request #865 from ReneSac/devel
Additions to the language manual and tests of new procedure call syntax.
Diffstat (limited to 'tests/parser/tcommand_as_expr.nim')
-rw-r--r--tests/parser/tcommand_as_expr.nim12
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