S
stephan.zimmer
Dear all,
say I'm given a function "f" taking a block as argument:
def f(&block)
# some code
p "#{block.to_code}"
end
Is there any way to access the source code of the block, i.e. for
calling "f { x+1 }"
the "to_code" function would give back "x+1"?
Stephan
say I'm given a function "f" taking a block as argument:
def f(&block)
# some code
p "#{block.to_code}"
end
Is there any way to access the source code of the block, i.e. for
calling "f { x+1 }"
the "to_code" function would give back "x+1"?
Stephan