From: Brad Phelan Date: 2006-12-21T01:03:09+09:00 Subject: Re: ruby gotchas Mark Guzman wrote: > I've written up some ruby gotchas that have come up while using ruby. > I'm wondering if there are any other gotchas that I should be aware of. > The list is available at: > http://hasno.info/2006/12/14/ruby-gotchas-and-caveats > > I was considering adding &&= to the list as it's functionality seemed a > bit odd to me at first. > --mark > The follow gets on my nerves a bit class A def foo yield "foo" end end a = A.new a.foo do |a| puts a end a.foo do |a| puts a end --- foo test.rb:12: undefined method `foo' for "foo":String (NoMethodError) --- Arguments to blocks are not scoped locally if the name already exists in the outer scope. I think this might be changing in Ruby 2.0??? -- Brad Phelan http://xtargets.com