On Jul 9, 2011, at 4:19 PM, Rodrigo Rosenfeld Rosas wrote:
> Em 09-07-2011 20:13, Nobuyoshi Nakada escreveu:
>> At Sun, 10 Jul 2011 08:01:58 +0900,
>> Rodrigo Rosenfeld Rosas wrote in [ruby-core:37936]:
>>> This is the equivalent in Slop:
>>>=20
>>> <pre>
>>> require 'slop'
>>>=20
>>> opts =3D Slop.parse do
>>>   banner "Usage: example.rb [options]"
>>>   on :v, :verbose, "Run verbosely", :default =3D>  true
>>> end
>>>=20
>>> p opts.to_hash
>>> </pre>
>> Hidden instance_eval is cause of confusion.  It's a way
>> OptionParser has thrown away.
>=20
> 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.=