V
Vasco Andrade e Silva
Hi,
def f_ok(node)
func = lambda {|n| pin_lambda, n); n }
p node, func.call(node[:xpto]), node
end
"ohoh"
{:xpto=>"ohoh"}
"ohoh"
{:xpto=>"ohoh"}
def f_ko(node)
func = lambda {|node| pin_lambda, node); node }
p node, func.call(node[:xpto]), node
end
"ohoh"
{:xpto=>"ohoh"}
"ohoh"
"ohoh" # ohoh... should be {:xpto=>"ohoh"}, or not??
I can't get any kind of explanation for this. Does anybody have one?
Why "node" in lambda isn't shadowed correctly (as i expected, at least)?
Well "node" is shadowed correctly but seems to be producing side
effects...
Thanks,
Vasco Andrade e Silva
def f_ok(node)
func = lambda {|n| pin_lambda, n); n }
p node, func.call(node[:xpto]), node
end
:in_lambdaf_ok({:xpto => "ohoh"})
"ohoh"
{:xpto=>"ohoh"}
"ohoh"
{:xpto=>"ohoh"}
def f_ko(node)
func = lambda {|node| pin_lambda, node); node }
p node, func.call(node[:xpto]), node
end
:in_lambdaf_ko({:xpto => "ohoh"})
"ohoh"
{:xpto=>"ohoh"}
"ohoh"
"ohoh" # ohoh... should be {:xpto=>"ohoh"}, or not??
I can't get any kind of explanation for this. Does anybody have one?
Why "node" in lambda isn't shadowed correctly (as i expected, at least)?
Well "node" is shadowed correctly but seems to be producing side
effects...
Thanks,
Vasco Andrade e Silva