From: Greg Fodor Date: 2007-05-25T17:15:05+09:00 Subject: Re: Introducing the "it" keyword > $_ releases after the method. Ah. This works today: return $_ if $_ = opts[:user] But it's still hard to read :) And don't forget: $_ = "foo" puts $_ if ($_ = "bob" && chomp) will print "foo"! (I feel like I'm back writing Perl again) > p *my_strings.map(:pluralize).grep(/tests/) Ah, yes, my ruby-fu is lacking, but it was a contrived example :) Here's another contrived one.. the gist is that you may need to use "it" more than just as a passthrough: my_strings.map { it.substring(it.maxlen) }.filter { it.size > 5 }.each { p "#{it}: #{it.size}" } > def it > @it = block_given? ? yield : @it > end > > p it if it{ 'bar' } > Neat. Instance variable could leak, but still neat! And Re: Rspec, well, if the powers that be (not me) like 'it', then I guess they'll have to move out of the way :)