------ art_6856_5143509.1145457419271 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/19/06, ts <decoux / moulon.inra.fr> wrote: > > >>>>> "R" == Robert Dober <robert.dober / gmail.com> 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 = 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 > #<Proc:0xb7e394e8 / b.rb:9> > 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óŐise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------ art_6856_5143509.1145457419271--