From: Robert Dober Date: 2006-04-19T23:37:02+09:00 Subject: Re: interested in metaprogramming? ------=_Part_6856_5143509.1145457419271 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/19/06, ts wrote: > > >>>>> "R" =3D=3D Robert Dober writes: > > >> define_method(:a) {|a, &b| > > > R> ^ > R> | > R> Here we go -----------------------+ > > R> do_something(a, &b) > > Well you have also this > > moulon% cat b.rb > #!/usr/bin/ruby > class Mine > c =3D 24 > define_method(:a) {|a, &b; c| > p a, b ,c > } > end > > Mine.new.a(12) {|x| puts "block #{x}" } > > moulon% > > moulon% ruby -v b.rb > ruby 1.9.0 (2006-04-08) [i686-linux] > b.rb:4: warning: shadowing outer local variable - c > 12 > # > nil > moulon% > > > Guy Decoux > > Ok let's all stop talking about ruby 1.8 it is too boring, just kidding. Ty for the enlightment ;) Cheers Robert -- Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_6856_5143509.1145457419271--