--0016e659f4e8a9e69c0491f93b0c
Content-Type: text/plain; charset=ISO-8859-1

Note that "binding" is the default argument of eval if you don't specify
one, so capturing binding as a variable and passing it explicitly is
redundant.

On Wed, Oct 6, 2010 at 1:53 PM, Martin DeMello <martindemello / gmail.com>wrote:

> On Thu, Oct 7, 2010 at 12:38 AM, John Sikora <john.sikora / xtera.com>
> wrote:
> > Hmmm, it seems to work when x is already defined (in 1.9.2):
> >
> > irb(main):001:0> x@> > 4
> > irb(main):002:0> bding
> > #<Binding:0xfa2ab0>
> > irb(main):003:0> eval("xP, b)
> > 5
> > irb(main):004:0> x
> > 5
> > irb(main):005:0>
> >
> > If I do not set x to a value beforehand, I get the same error. Do not
> > know why though.
>
> Oddly enough, if x is defined beforehand you don't even need the binding:
>
> ruby-1.9.2-p0 > x  
>  5
> ruby-1.9.2-p0 > eval "x  2"
>  42
> ruby-1.9.2-p0 > x
>  42
>
> martin
>
>


-- 
Tony Arcieri
Medioh! A Kudelski Brand

--0016e659f4e8a9e69c0491f93b0c--