RosettaCodeData/Task/Call-a-function/11l/call-a-function.11l

18 lines
259 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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