Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eval in a method doesn't use the namespace of the class in Rakudo #958

Closed
p6rt opened this issue Apr 29, 2009 · 5 comments
Closed

eval in a method doesn't use the namespace of the class in Rakudo #958

p6rt opened this issue Apr 29, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Apr 29, 2009

Migrated from rt.perl.org#65238 (status was 'resolved')

Searchable as RT65238$

@p6rt
Copy link
Author

p6rt commented Apr 29, 2009

From @masak

<masak> rakudo​: class A { sub bar() { return 42 }; method foo() { say
bar; say eval("bar") } }; A.new.foo
<p6eval> rakudo 654500​: OUTPUT«42␤␤»
<azawawi> moritz_​: regarding http://nopaste.snit.ch/16441 ; std seems
to complain
<moritz_> masak​: I think it should print 42 again
<masak> moritz_​: do you know if it's reported?
<moritz_> masak​: don't think so
* masak submits rakudobug, just in case
<masak> rakudo​: sub bar() { return 12 }; class A { sub bar() { return
42 }; method foo() { say bar; say eval("bar") } }; A.new.foo
<p6eval> rakudo 654500​: OUTPUT«42␤12␤»
<masak> for some reason the eval resets to the outer namespace.

@p6rt
Copy link
Author

p6rt commented Apr 29, 2009

From @moritz

There's a test for that now in t/spec/integration/packages.t (it uses a
package instead of a class, and no method, but I think it's exactly the
same underlying issue).

@p6rt
Copy link
Author

p6rt commented Apr 29, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 1, 2009

From @jnthn

On Wed Apr 29 01​:31​:53 2009, masak wrote​:

<masak> rakudo​: class A { sub bar() { return 42 }; method foo() { say
bar; say eval("bar") } }; A.new.foo
<p6eval> rakudo 654500​: OUTPUT«42␤␤»

Now as of git 3262dd7 prints 42 twice; unfudged the test from moritz++
in t/spec/integration/packages.t also.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented May 1, 2009

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 1, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant