4 ms·
I tried to pass the codeProc.call in the block but it wouldn't process the data until I passed the codeProc as a parameter. I don't really understand why to be
by Readmore 19y ago
I tried to pass the codeProc.call in the block but it wouldn't process the data until I passed the codeProc as a parameter. I don't really understand why to be honest.
- bct 19y agoI don't know why it wouldn't have. You should have been able to do: out = parseClosure(curr_page, cnt) { |doc,out| eval(codeStr) } ... def parseClosure(curr_page, cnt) ... yield(doc, out) or: def parseClosure(curr_page, cnt, &codeProc) There's not much opportunity to use lambda explicity in Ruby because using blocks instead is so easy.
- Readmore 19y agoYou are correct sir! I bow to your ruby-fu! Thanks.