From: "Hal E. Fulton" Date: 2003-02-10T05:31:36+09:00 Subject: Re: I have method call, but I get warning: ... interpreted as method call! ----- Original Message ----- From: "Sam Roberts" To: "ruby-talk ML" Sent: Sunday, February 09, 2003 2:04 PM Subject: I have method call, but I get warning: ... interpreted as method call! > The code works, I just get this warning: > > ./vcard.rb:246: warning: each_with (...) interpreted as method call > > but, I don't know how to make my method calls look any more like a > method call than they already do! > > What's going on? > > # Calls block once for each field for which +cond+ is true. > def each_with(block, &cond) # :yields: field > @fields.each { |field| if cond.call(field); block.call(field); end } > end > > # Calls block once for each field named +name+. > def each_with_name(name, &block) # :yields: field > each_with (block) { |field| field.name?(name) } <----------- causes a warning, but why? > end My first guess (untested) is that it's the space before the parens that is causing the parser to do a doubletake. Hal