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

18 lines
259 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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