summary refs log blame commit diff stats
path: root/tests/parser/tcommand_as_expr.nim
blob: 22c49ab3f214e5b7e1a547a7371104a0bb2dc53f (plain) (generated by cgit-pink 1.4.1-2-gfad0 (git 2.36.2.497.gbbea4dcf42) at 2025-02-05 09:44:22 +0000
oid'>79f59d18f ^
300c0376b ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
           
                

         
   
            
 
                                             



                                


                              

                               


                             
 

                                            
discard """
  output: '''140
5-120-120
359'''
"""
#import math

proc optarg(x:int, y:int = 0):int = x + 3 * y
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)
let z = singlearg 1.foo foo 8
    
echo x, y, z

let a = [2,4,8].map do (d:int) -> int: d + 1
echo a[0], a[1], a[2]