From: Yusuke ENDOH Date: 2007-12-21T00:30:29+09:00 Subject: Re: named captures assigning to local variables Hi, 2007/12/20, Tanaka Akira : > =~ has some magic already. It is not redefinable for regexp > literals. > > % ./ruby -e ' > class Regexp > def =~ > p :called > end > end > p /b/ =~ "abc" > ' > 1 > % ./ruby -v > ruby 1.9.0 (2007-12-20 patchlevel 0) [i686-linux] Sorry slightly off topic, but I wonder if it's ok to be able to redefine Regexp#=~ if YARV's optimization is disabled. Is it intended? Should the optimization flag be considered as `Easter egg'? $ ./ruby -e ' VM::InstructionSequence.compile_option = false eval %q( class Regexp def =~(x) p :called end end p /b/ =~ "abc" ) ' :called :called -- Yusuke ENDOH