Umm… actually I’m not familiar with macros.
I think that it is enough to solve the below problem:
function _my_func(a, b)
c = 2*a
b = b + 1
a + b
end
function my_func(a)
b = a
@log _my_func(a, b)
end
Then, the definition of my_func
should be
function my_func(a)
b = a
# the content of `_my_func`. It must not change the above `b`... how?
c = 2*a
b = b + 1
a+b
#
end
Do you have any idea?
EDIT:
Ah, generate a new function _my_func__LOG__
and run it may work.
But I don’t still know how to generate _my_func__LOG__
as the following.
This question is continued at the next question.
function my_func(a)
b = a
# the content of `_my_func`. It must not change the above `b`... how?
function _my_func__LOG__(a, b)
c = 2*a
b = b + 1
a+b
end
_my_func__LOG__(a, b)
#
end