4 ms·
I'm not sure, but I think your counterexample is meant to show you can't replace `Array#pop`. However, that's not what you show -- you show that irb depends on
by hjdivad 18y ago
I'm not sure, but I think your counterexample is meant to show you can't replace `Array#pop`. However, that's not what you show -- you show that irb depends on `Array#pop` for its normal usage.
Consider:
$ ruby -e "class Array; def pop; self.first; end; end; puts [1,2,3].pop"
1
- deleted 18y ago[deleted]