summary refs log tree commit diff stats
path: root/tests/parser/tcommand_as_expr.nim
blob: a9747b0acded58713ab8a6c1ffa93413413a1ea7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  output: '''140
5-120'''
"""

proc optarg(x:int):int = x
proc singlearg(x:int):int = 20*x
echo optarg 1, singlearg 2


proc foo(x: int): int = x-1
proc foo(x, y: int): int = x-y

let x = optarg foo 7.foo
let y = singlearg foo(1, foo 8)

echo x, y