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

use PDL::Lite; only loads functions for first package it is called in #146

Closed
shawnlaffan opened this issue Aug 31, 2015 · 2 comments
Closed

Comments

@shawnlaffan
Copy link
Contributor

Using PDL::Lite in more than one package only imports pdl and the other standard functions in the first package it is called from.

Code to reproduce is below.

The code works if use PDL::Lite is replaced with with use PDL or use PDL::LiteF, or if pdl() is set using a glob.

If a use PDL::Lite is put before the first package declaration then neither sub call works.

Tested on StrawberryPerl 5.20, pdl 2.012 and pdl 2.013.

Regards,
Shawn.

package mk1 {
    use PDL::Lite;

    sub x {
        return pdl (1..10);
    }
}

package mk2 {
    use PDL::Lite;
    #*pdl = \&PDL::Core::pdl;  #  uncomment and the code works
    sub x {
        return pdl (11..20);
    }
}

print mk1::x, "\n";  #  [1 2 3 4 5 6 7 8 9 10]
print mk2::x, "\n";  #  Undefined subroutine &mk2::pdl called at xx.t line 21.
@mohawk2
Copy link
Member

mohawk2 commented Aug 31, 2015

Hi @shawnlaffan, may I suggest you close this and reopen on https://github.com/PDLPorters/pdla-core ? You can PR a failing test / fix and it will be released within hours or days, not months.

@shawnlaffan
Copy link
Contributor Author

Issue ported across.

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

2 participants