17 lines
259 B
Text
17 lines
259 B
Text
F no_args() {}
|
||
// call
|
||
no_args()
|
||
|
||
F fixed_args(x, y)
|
||
print(‘x=#., y=#.’.format(x, y))
|
||
// call
|
||
fixed_args(1, 2) // x=1, y=2
|
||
|
||
// named arguments
|
||
fixed_args(x' 1, y' 2)
|
||
|
||
F opt_args(x = 1)
|
||
print(x)
|
||
// calls
|
||
opt_args() // 1
|
||
opt_args(3.141) // 3.141
|