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

problems when using require ::($m) #6196

Open
p6rt opened this issue Apr 17, 2017 · 6 comments
Open

problems when using require ::($m) #6196

p6rt opened this issue Apr 17, 2017 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Apr 17, 2017

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

Searchable as RT131168$

@p6rt
Copy link
Author

p6rt commented Apr 17, 2017

From @MARTIMM

Since I've installed perl6 version 2017.03-234-g0ebdaa4 built on MoarVM
version 2017.03-128-gc9ab59c, several modules are experiencing failures
when using the following construct (golfed down)(I am sure that the
module loads)

my $m = 'somemodule';
require :​:($m);
my $o = :​:($m).new;

However, in a simple setup it works fine. I could manage to rewrite
things in such a way that errors disappear, but I do not understand it.
A question is 'Are the symbols loaded lexically in such a way that it is
not possible to instantiate the class in another method?'

A remaining bug on windows(with latest rakudostar) shows the error;

Failed to load Config​::TOML;
Lexical with name '&from-toml' does not exist in this frame

when using something like the following

my $m = 'Config​::TOML';
require :​:($m) <&from-toml>;

see also
https://ci.appveyor.com/project/MARTIMM/config-datalang-refine/branch/master

Other things I've seen before are; not able to find the class name
symbol when I want to instatiate the class, or the .^name is shorter
than the real class name should be, which accounts for the first error.

Regards,
Marcel

@p6rt
Copy link
Author

p6rt commented Apr 17, 2017

From @zoffixznet

On Mon, 17 Apr 2017 09​:53​:28 -0700, mt1957@​gmail.com wrote​:

Since I've installed perl6 version 2017.03-234-g0ebdaa4 built on MoarVM
version 2017.03-128-gc9ab59c, several modules are experiencing failures
when using the following construct (golfed down)(I am sure that the
module loads)

my $m = 'somemodule';
require :​:($m);
my $o = :​:($m).new;

However, in a simple setup it works fine. I could manage to rewrite
things in such a way that errors disappear, but I do not understand it.
A question is 'Are the symbols loaded lexically in such a way that it is
not possible to instantiate the class in another method?'

A remaining bug on windows(with latest rakudostar) shows the error;

Failed to load Config​::TOML;
Lexical with name '&from-toml' does not exist in this frame

when using something like the following

my $m = 'Config​::TOML';
require :​:($m) <&from-toml>;

see also
https://ci.appveyor.com/project/MARTIMM/config-datalang-refine/branch/master

Other things I've seen before are; not able to find the class name
symbol when I want to instatiate the class, or the .^name is shorter
than the real class name should be, which accounts for the first error.

Regards,
Marcel

Can't reproduce either of the issues you describe. Do you have a piece of code we can run that repos the problem?

Also, have you seen the lexical require Upgrade Notification? http://rakudo.org/2017/03/18/lexical-require-upgrade-info/

  my $m = 'Test';
  require :​:($m) <&ok>;
  ok 1, 1;
  # OUTPUT​: ok 1 - 1

  my $m = 'DBIish';
  require :​:($m);
  my $o = :​:($m).new;
  dd $o;
  # OUTPUT​: DBIish $o = DBIish.new

@p6rt
Copy link
Author

p6rt commented Apr 17, 2017

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

@p6rt
Copy link
Author

p6rt commented Apr 17, 2017

From @zoffixznet

For record, I ran my test on Rakudo version 2017.03-292-g0b5a41b built on MoarVM version 2017.03-138-g40881cd

@p6rt
Copy link
Author

p6rt commented Apr 17, 2017

From @MARTIMM

On 17-04-17 19​:12, Zoffix Znet via RT wrote​:

thanks for the link, I will look into it.

The code for which the windows implementation fails but not on linux,
can be found here;

https://github.com/MARTIMM/config-datalang-refine/blob/master/lib/Config/DataLang/Refine.pm6

the requires are at line 57 and 64
and the error is thrown at line 193 where the function is used.

thanks again,
Marcel

On Mon, 17 Apr 2017 09​:53​:28 -0700, mt1957@​gmail.com wrote​:

Since I've installed perl6 version 2017.03-234-g0ebdaa4 built on MoarVM
version 2017.03-128-gc9ab59c, several modules are experiencing failures
when using the following construct (golfed down)(I am sure that the
module loads)

my $m = 'somemodule';
require :​:($m);
my $o = :​:($m).new;

However, in a simple setup it works fine. I could manage to rewrite
things in such a way that errors disappear, but I do not understand it.
A question is 'Are the symbols loaded lexically in such a way that it is
not possible to instantiate the class in another method?'

A remaining bug on windows(with latest rakudostar) shows the error;

Failed to load Config​::TOML;
Lexical with name '&from-toml' does not exist in this frame

when using something like the following

my $m = 'Config​::TOML';
require :​:($m) <&from-toml>;

see also
https://ci.appveyor.com/project/MARTIMM/config-datalang-refine/branch/master

Other things I've seen before are; not able to find the class name
symbol when I want to instatiate the class, or the .^name is shorter
than the real class name should be, which accounts for the first error.

Regards,
Marcel

Can't reproduce either of the issues you describe. Do you have a piece of code we can run that repos the problem?

Also, have you seen the lexical require Upgrade Notification? http://rakudo.org/2017/03/18/lexical-require-upgrade-info/

 my $m = 'Test';
 require :&#8203;:\($m\) \<&ok>;
 ok 1, 1;
 \# OUTPUT&#8203;: ok 1 \- 1

 my $m = 'DBIish';
 require :&#8203;:\($m\);
 my $o = :&#8203;:\($m\)\.new;
 dd $o;
 \# OUTPUT&#8203;: DBIish $o = DBIish\.new

@p6rt
Copy link
Author

p6rt commented Apr 17, 2017

From @MARTIMM

I understand that the symbols must be used in the same block as the
require statement. There is then still a problem, namely the difference
between linux and windows.

In the mean time I will try to get the usage of the functions to the
block where it is required.

Marcel

On 17-04-17 19​:12, Zoffix Znet via RT wrote​:

thanks for the link, I will look into it.

The code for which the windows implementation fails but not on linux,
can be found here;

https://github.com/MARTIMM/config-datalang-refine/blob/master/lib/Config/DataLang/Refine.pm6

the requires are at line 57 and 64
and the error is thrown at line 193 where the function is used.

thanks again,
Marcel

On Mon, 17 Apr 2017 09​:53​:28 -0700, mt1957@​gmail.com wrote​:

Since I've installed perl6 version 2017.03-234-g0ebdaa4 built on MoarVM
version 2017.03-128-gc9ab59c, several modules are experiencing failures
when using the following construct (golfed down)(I am sure that the
module loads)

my $m = 'somemodule';
require :​:($m);
my $o = :​:($m).new;

However, in a simple setup it works fine. I could manage to rewrite
things in such a way that errors disappear, but I do not understand it.
A question is 'Are the symbols loaded lexically in such a way that it is
not possible to instantiate the class in another method?'

A remaining bug on windows(with latest rakudostar) shows the error;

Failed to load Config​::TOML;
Lexical with name '&from-toml' does not exist in this frame

when using something like the following

my $m = 'Config​::TOML';
require :​:($m) <&from-toml>;

see also
https://ci.appveyor.com/project/MARTIMM/config-datalang-refine/branch/master

Other things I've seen before are; not able to find the class name
symbol when I want to instatiate the class, or the .^name is shorter
than the real class name should be, which accounts for the first error.

Regards,
Marcel

Can't reproduce either of the issues you describe. Do you have a piece of code we can run that repos the problem?

Also, have you seen the lexical require Upgrade Notification? http://rakudo.org/2017/03/18/lexical-require-upgrade-info/

  my $m = 'Test';
  require :&#8203;:\($m\) \<&ok>;
  ok 1, 1;
  \# OUTPUT&#8203;: ok 1 \- 1

  my $m = 'DBIish';
  require :&#8203;:\($m\);
  my $o = :&#8203;:\($m\)\.new;
  dd $o;
  \# OUTPUT&#8203;: DBIish $o = DBIish\.new

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