RosettaCodeData/Task/Named-parameters/Maple/named-parameters.maple

11 lines
519 B
Plaintext

f := proc(a, {b:= 1, c:= 1})
print (a*(c+b));
end proc:
#a is a mandatory positional parameter, b and c are optional named parameters
f(1);#you must have a value for a for the procedure to work
2
f(1, c = 1, b = 2);
3
f(2, b = 5, c = 3);#b and c can be put in any order
16