cleaned up command expressions
This commit is contained in:
parent
7196c7637e
commit
c30f6cfcf1
4 changed files with 29 additions and 18 deletions
|
|
@ -1,12 +1,17 @@
|
|||
discard """
|
||||
output: "12"
|
||||
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 = foo 7.foo, # comment here
|
||||
foo(1, foo 8)
|
||||
# 12 = 6 - -6
|
||||
echo x
|
||||
let x = optarg foo 7.foo
|
||||
let y = singlearg foo(1, foo 8)
|
||||
|
||||
echo x, y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue