I would like to assign variables in functions. For example,
function func(p)
a = A(p)
b = B(p)
c = C(p)
# Then do something using a, b, c
end
Those a, b, c
are parameters I want to use in the function, and they depend on another parameter p
.
The same parameters are used in several functions, and I don’t want to repeat the same assignment in all the functions.
It seems that I can use a macro with esc()
to replace the assignment statement, but is therer a better way to do this?
Thank you.