From: jason white Date: 2006-12-07T11:01:47+09:00 Subject: Re: invasive parameters as method mode variables --0-1422468727-1165446033=:74856 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable These e-mails are becoming invasive. take me off of this list.=0A=0A=0A----= - Original Message ----=0AFrom: Trans =0ATo: ruby-talk= ML =0ASent: Wednesday, December 6, 2006 4:57:16 P= M=0ASubject: Re: invasive parameters as method mode variables=0A=0A=0ARober= t Klemme wrote:=0A> On 06.12.2006 18:37, Trans wrote:=0A> > ara.t.howard@no= aa.gov wrote:=0A> >=0A> >> method + state =3D> object=0A>=0A> I would have = put it differently: command pattern. Your method seems=0A> pretty complex = so you can change it into a command object. If the=0A> problem at hand is = complex then it probably needs a complex solution.=0A> But I would not go d= own the metaprogramming route.=0A>=0A> > good point. though it moves me awa= y from the simplicity of single call.=0A> > also i wonder about things like= String#each. the global default for=0A> > separator is not really the idea= l implementation, but #each can't be=0A> > made a class.=0A>=0A> Really?=0A= >=0A> >> require 'enumerator'=0A> =3D> true=0A> >> %w{foo bar baz}.to_enu= m(:each)=0A> =3D> #=0A=0ASure. But I would= think it preferable to just call str.each. Not have=0Ato resort to Enumera= tors. Doing...=0A=0A "this is a string".to_enum(:each, //).select { |c| ..= =0A=0Ais less efficent and less readable (once you know what $/ is) then=0A= =0A $/ =3D // ; "this is a string".select { |c| ...=0A=0AAnd if we can do = it gloablly, which is not ideal, then why not do it=0Abetter with a local "= method mode variable"?=0A=0AOf course, I'm still not sure why it's such a b= ad idea to allow=0AEnumberable to pass thru a parameter to #each.=0A=0AT.= =0A=0A__________________________________________________=0ADo You Yahoo!?= =0ATired of spam? Yahoo! Mail has the best spam protection around =0Ahttp:= //mail.yahoo.com --0-1422468727-1165446033=:74856--