Skip to content

Commit

Permalink
Merge pull request #260 from PDLPorters/fix-lite
Browse files Browse the repository at this point in the history
Fix PDL::Lite
  • Loading branch information
mohawk2 committed Apr 14, 2019
2 parents 46d656c + 184ebe0 commit 7b0c5cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Basic/Lite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ Access to other functions is by method syntax, viz:
=cut

# Load the fundamental PDL packages, no imports
# Because there are no imports, we do not need
# the usual 'eval in the user's namespace' routine.
package PDL::Lite;

use strict;
use warnings;

use PDL::Core '';
use PDL::Core qw(pdl piddle barf null);
use PDL::Ops '';
use PDL::Primitive '';
use PDL::Ufunc '';
Expand All @@ -45,12 +46,11 @@ use PDL::Bad '';
use PDL::Version ; # Doesn't export anything - no need for ''
use PDL::Lvalue;

package PDL::Lite;
$VERSION = $PDL::Version::VERSION;
our $VERSION = $PDL::Version::VERSION;

@ISA = qw( PDL::Exporter );
our @ISA = qw( PDL::Exporter );

@EXPORT = qw( piddle pdl null barf ); # Only stuff always exported!
our @EXPORT = qw( piddle pdl null barf ); # Only stuff always exported!
our %EXPORT_TAGS = (
Func => [@EXPORT],
);
Expand Down
5 changes: 4 additions & 1 deletion t/lite_loads_twice.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Can PDL::Lite be loaded twice?
# The first import was interfering with the second.

use Test::More tests => 10;
use Test::More tests => 11;

{
package mk1;
Expand All @@ -26,3 +26,6 @@ foreach my $name (qw /x barf pdl piddle null/) {
ok (mk2->can($name), "Sub loaded: mk2::" . $name);
}

# now try calling one of those functions
eval { my $x = mk1::pdl(0, 1) };
is $@, '', 'the imported pdl function ACTUALLY WORKS';

0 comments on commit 7b0c5cf

Please sign in to comment.