Permalink
Browse files

Rename v6::inline to v6-inline for compatibility with Perl < 5.18

  • Loading branch information...
niner committed Dec 3, 2016
1 parent 9f07780 commit f91ab9a270a4797540fde7f18562076368b1177a
Showing with 11 additions and 13 deletions.
  1. +3 −3 README.md
  2. +6 −8 lib/Inline/Perl5.pm6
  3. +1 −1 t/lib/TestV6.pm
  4. +1 −1 t/lib/TestV6Directly.pm
View
@@ -311,14 +311,14 @@ can be caught like any other Perl 5 exceptions:
## Mix Perl 5 and Perl 6 code in the same file
-Inline::Perl5 creates a virtual module called "v6::inline". By saying
-"use v6::inline;" in a Perl 5 module, you can declare that the rest of the file
+Inline::Perl5 creates a virtual module called "v6-inline". By saying
+"use v6-inline;" in a Perl 5 module, you can declare that the rest of the file
is written in Perl 6:
```
package Some::Perl5::Module;
- use v6::inline;
+ use v6-inline;
has $.name;
View
@@ -1130,12 +1130,6 @@ method init_callbacks {
v6::invoke($static_class, 'new_shadow_of_p5_object', $object);
return $object;
}
-
- sub import {
- die 'v6-inline got renamed to v6::inline to allow passing an import list';
- }
-
- package v6::inline;
use mro;
sub install_function {
@@ -1162,7 +1156,6 @@ method init_callbacks {
my $package_to_create;
sub import {
- my ($class, %args) = @_;
my $package = $package_to_create = scalar caller;
push @inlined, $package;
}
@@ -1173,6 +1166,11 @@ method init_callbacks {
};
}
+ package v6::inline;
+
+ sub import {
+ die 'v6::inline got renamed to v6-inline for compatibility with older Perl 5 versions. Sorry for the back and forth about this.';
+ }
$INC{'v6.pm'} = '';
$INC{'v6/inline.pm'} = '';
@@ -1198,7 +1196,7 @@ method rebless(Perl5Object $obj, Str $package, $p6obj) {
}
method install_wrapper_method(Str:D $package, Str $name, *@attributes) {
- self.call('v6::inline::install_p6_method_wrapper', $package, $name, |@attributes);
+ self.call('v6::install_p6_method_wrapper', $package, $name, |@attributes);
}
role Perl5Package[Inline::Perl5 $p5, Str $module] {
View
@@ -139,7 +139,7 @@ sub check_attrs {
return attributes::get(\&hasattrs);
}
-use v6::inline;
+use v6-inline;
has $.name;
View
@@ -12,7 +12,7 @@ sub search {
1
}
-use v6::inline;
+use v6-inline;
method foo() {
self.search;

0 comments on commit f91ab9a

Please sign in to comment.