>> f = function [public alpha = 3, public beta = 5] x -> y y = alpha * x + beta * y; end >> f.alpha 3 >> f.alpha = -5; >> f.alpha -5 >> f.beta = 10; >> f.beta 10It's impossible to change the value of a public parameter inside the function body. For example, if we do
>> f = function [public alpha = 3, public beta = 5] x -> y alpha = 10; ... end >> f.alpha 3we merely creates a local variable whose name is alpha and value is 10. And
>> f = function [public alpha = 3, public beta = 5] x -> y this.alpha = 10; ... endwill result in a compile error. The purpose of this restriction is to reduce the implicit behavior of a function. The owner (the surrounding scope) of a function can always predict the behavior of a function as long as it only has public parameters because the function itself cannot change its public parameter values.