7 ms·
Ruby already has perl-like magic variables. Too bad $1 $2.. are already used to hold regexp matches if I remember correctly. I suspect they could have introduc
by zimbatm 8y ago
Ruby already has perl-like magic variables. Too bad $1 $2.. are already used to hold regexp matches if I remember correctly.
I suspect they could have introduced $it for single-variable blocks and not break the existing parsers.
- vidarh 8y ago$ signifies a global variable, so changes are $it would break some existing codebase somewhere.
- Dirlewanger 8y agoThankfully, it's heavily frowned-upon to use global variables.