Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

unexpected behaviour during EVAL() #3438

Open p6rt opened 10 years ago

p6rt commented 10 years ago

Migrated from rt.perl.org#122289 (status was 'open')

Searchable as RT122289$

p6rt commented 10 years ago

From @teodozjan

Evaling objects won't work if code that eval was preompiled independently. In this case class Planet and Class SpaceStation are somewhat inaccesible in imported sub. Even though putting slurp $path as argument of eval will fail. It was working on parrot but before big changes that made parrot backend unusable (random issues) in my project.

=begin pod   #FAILS on MOAR   @​planets = from_file($path_planets);   #the same as below   # https://github.com/teodozjan/perl-store/blob/master/lib/PerlStore/FileStore.pm   @​stations = from_file($path_stations);

=end pod

  #moar hack   note 'Readin $path_planets';   my $plan = slurp $path_planets;   @​planets = EVAL $plan;

  #moar hack   note 'Readin $path_stations';   my $stat = slurp $path_stations;   @​stations = EVAL $stat;

LOADING /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client + /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client (12 - 16) multi sub MAIN(​:$tasks!, Bool :$update?){
my Client $client .= new;
create_session;

r LOADING EVAL_0 LOADING EVAL_1 LOADING EVAL_2 + Uncaught Exception | Cannot invoke this object (REPR​: Null, cs = 0) + /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client (23 - 27) | BodyBuilder.process_all_bodies; | } else { | BodyBuilder.read; | } | for @​todo -> $willdo { q - Run END blocks (y/N)?

$ perl6 --version This is perl6 version 2014.06-118-gb25b868 built on MoarVM version 2014.06-63-g0fb638b

-- Pozdrawiam

Kamil Kułaga

p6rt commented 6 years ago

From @AlexDaniel

Hmmm… Parrot is in the past as of today, and I wish it was possible to try this on MoarVM. What's the way to reproduce this issue?

On 2014-07-14 02​:31​:54, teodozjan wrote​:

Evaling objects won't work if code that eval was preompiled independently. In this case class Planet and Class SpaceStation are somewhat inaccesible in imported sub. Even though putting slurp $path as argument of eval will fail. It was working on parrot but before big changes that made parrot backend unusable (random issues) in my project.

=begin pod #FAILS on MOAR @​planets = from_file($path_planets); #the same as below # https://github.com/teodozjan/perl- store/blob/master/lib/PerlStore/FileStore.pm @​stations = from_file($path_stations);

=end pod

#moar hack note 'Readin $path_planets'; my $plan = slurp $path_planets; @​planets = EVAL $plan;

#moar hack note 'Readin $path_stations'; my $stat = slurp $path_stations; @​stations = EVAL $stat;

LOADING /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client + /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client (12 - 16) multi sub MAIN(​:$tasks!, Bool :$update?){
my Client $client .= new;
create_session;

r LOADING EVAL_0 LOADING EVAL_1 LOADING EVAL_2 + Uncaught Exception | Cannot invoke this object (REPR​: Null, cs = 0) + /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client (23 - 27) | BodyBuilder.process_all_bodies; | } else { | BodyBuilder.read; | } | for @​todo -> $willdo { q - Run END blocks (y/N)?

$ perl6 --version This is perl6 version 2014.06-118-gb25b868 built on MoarVM version 2014.06-63-g0fb638b

p6rt commented 6 years ago

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

p6rt commented 6 years ago

From @teodozjan

Hi Aleks,

Thanks for reminder i totally forgot about this RT.

Looks like it was fine in 2015 https://github.com/teodozjan/lacuna-cookbuk/commit/f2ebae3efda06f35b1d679e17e14c259bd718b95#diff-73e69e63f060cafc548379f4dcc52105 shall i test it to be 100% sure or you want to close it?

On Sun, Dec 3, 2017 at 6​:00 AM, Aleks-Daniel Jakimenko-Aleksejev via RT \< perl6-bugs-followup@​perl.org> wrote​:

Hmmm… Parrot is in the past as of today, and I wish it was possible to try this on MoarVM. What's the way to reproduce this issue?

On 2014-07-14 02​:31​:54, teodozjan wrote​:

Evaling objects won't work if code that eval was preompiled independently. In this case class Planet and Class SpaceStation are somewhat inaccesible in imported sub. Even though putting slurp $path as argument of eval will fail. It was working on parrot but before big changes that made parrot backend unusable (random issues) in my project.

=begin pod #FAILS on MOAR @​planets = from_file($path_planets); #the same as below # https://github.com/teodozjan/perl- store/blob/master/lib/PerlStore/FileStore.pm @​stations = from_file($path_stations);

=end pod

#moar hack note 'Readin $path_planets'; my $plan = slurp $path_planets; @​planets = EVAL $plan;

#moar hack note 'Readin $path_stations'; my $stat = slurp $path_stations; @​stations = EVAL $stat;

LOADING /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client + /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client (12 - 16) multi sub MAIN(​:$tasks!, Bool :$update?){
my Client $client .= new;
create_session;

r LOADING EVAL_0 LOADING EVAL_1 LOADING EVAL_2 + Uncaught Exception | Cannot invoke this object (REPR​: Null, cs = 0) + /home/kamil/dev/lacuna-cookbuk/bin/lacunacookbuk_client (23 - 27) | BodyBuilder.process_all_bodies; | } else { | BodyBuilder.read; | } | for @​todo -> $willdo { q - Run END blocks (y/N)?

$ perl6 --version This is perl6 version 2014.06-118-gb25b868 built on MoarVM version 2014.06-63-g0fb638b

-- Pozdrawiam

Kamil Kułaga