From: "Ondřej Bílka" Date: 2011-07-10T13:17:14+09:00 Subject: [ruby-core:37947] Re: [Ruby 1.9 - Feature #5010][Open] Add Slop(-like) in stdlib and deprecate current OptionParser API On Sun, Jul 10, 2011 at 10:16:25AM +0900, Eric Hodel wrote: > On Jul 9, 2011, at 4:19 PM, Rodrigo Rosenfeld Rosas wrote: > > Em 09-07-2011 20:13, Nobuyoshi Nakada escreveu: > > > Sorry, Nobu, I didn't get it. Could you explain it better? > > I think Nobu means that formerly OptionParser used instance_eval like slop does inside the parse method. > > This was changed due to confusion of scoping and methods available inside and outside the instance_eval. > > I'd prefer not to have hidden instance_eval for option parsing. It's too often that I like to refer to items in a scope the execution environment doesn't have. This reminds me that I instead instance_eval rely on method injection. What I currently do is temporary add singleton method_missing to delegate methods. It has relatively sane scoping. I am wondering if there is way that is not as ugly as my current implementation. def redef(&b) b.binding.eval " class <