3 ms·
Ruby has always been a compromise where purity has almost always been sacrificed over convenience. It's not always obvious, until you start poking around the mu
by vidarh 8y ago
Ruby has always been a compromise where purity has almost always been sacrificed over convenience. It's not always obvious, until you start poking around the murkier parts of the Ruby grammar.
Keep in mind Ruby has a ton of Perl/Awk style global-like-but-actually-global variables already, for example (and awk-inspired command line Switches) - it's the bastard child of Perl and Smalltalk.
In this case I think that while it's slightly ufortunate to end up with "@", it will overall be clear - so much Ruby code with chained blocks are just using meaningless names on the basis that "everyone knows" what gets passed to map or collect etc. anyway, and especially in a chain where the same values often gets passed through multiple steps a positional argument will make no difference, as long as people strictly use them with common methods with known parameters.