From: ts Date: 2000-09-25T14:37:50+09:00 Subject: [ruby-talk:5094] Re: binding weirdness >>>>> "B" == Brian F Feldman writes: B> I notice that (using 1.6.0 and 1.6.1 snapshot; finding some other kinda B> strange problems, too...) 1.4 do the same B> {"/home/green"}$ irb B> irb(main):001:0> getopts it search getopts in self (i.e. ruby_top_self) and don't find it B> NameError: undefined local variable or method `getopts' for B> # it put the method in the cache (store empty info in the cache) B> (irb):1:in `irb_binding' B> irb(main):002:0> require 'getopts' B> true it define the method getopts in Object (rb_cObject) B> irb(main):003:0> getopts B> NameError: undefined local variable or method `getopts' for B> # it try to access getopts in self and first look in the cache and find it (empty info) B> (irb):3:in `irb_binding' B> irb(main):004:0> method :getopts 1) it search the method body (but don't try first to access the cache) 2) it find it in the Object 2) it put the method in the cache B> # B> irb(main):005:0> getopts it search in the cache and find the method defined in Object Guy Decoux