Commit 92934ab8 authored by Alessandro Ghedini's avatar Alessandro Ghedini

Imported Upstream version 2013.03

parent 7c273a43
......@@ -9,7 +9,7 @@ Rakudo Perl 6
does not contain any of the modules, documentation, or other items
that would normally come with a full Perl 6 distribution. If you're
after more than just the bare compiler, please download the latest
Rakudo Star package from http://github.com/rakudo/star/downloads .
Rakudo Star package from http://rakudo.org/downloads/star .
For a high-level overview of implemented and missing features,
please visit http://perl6.org/compilers/features .
......
New in 2013.03
+ Type names now gist as (Any) rather than Any()
+ Warn when pure expressions are used in sink context
+ Cool.substr(...) now correctly accepts whatever-star closures
+ Fix character class subtraction bugs
+ Correctly detect undeclared variables in regex assertions
+ :i now respected in character classes
+ Improved output of Rat.perl
+ Implemented shellwords postcircumfix (%h<< $x 'foo bar' >>)
+ User-defined circumfixes now parse a semilist rather than just an expression
and handle whitespace correctly
+ Forbid null operators
+ Warn about leading 0 not indicating octal in Perl 6
+ Fix some automatic end of statement on "}" parse bugs
+ Better error message on for(...) {} being interpreted as a function call
+ Array interpolations now properly do LTM
+ Respect :i in constructs like /:i <$var>/
+ Autothread "none" and "all" junctions before "any" and "one"
+ Helpful error if you write "else if"/"elif" instead of "elsif"
+ Throw exception if a Range is used as a Range endpoint
+ Corrected argument order in IO.seek
+ Multi-dispatch now mostly implemented in NQP, not C
+ Fixed LEAVE (and thus UNDO/KEEP/temp) not firing in multis or upon 'next'
in a for loop
New in 2013.02
+ "Did you mean ..." suggestions for symbol-not-found errors
+ Compile-time optimization of some cases of junctions in boolean context
......
......@@ -42,7 +42,6 @@ Operators
3 ** logical cascades
Regexes
2 ** array variable interpolation
2 ** ~~ inside regexes
2 * Null pattern detection (at parse time)
2 * :sigspace ignores leading whitespace
......
# Announce: Rakudo Perl 6 compiler, Development Release #62 ("Singapore")
On behalf of the Rakudo development team, I'm proud to announce the
March 2013 release of Rakudo Perl #62 "Singapore". Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine (see
<http://www.parrot.org>). The tarball for this release is available
from <http://rakudo.org/downloads/rakudo/>.
Please note: This announcement is not for the Rakudo Star
distribution[^1] --- it's announcing a new release of the compiler
only. For the latest Rakudo Star release, see
<http://rakudo.org/downloads/star/>.
The Rakudo Perl compiler follows a monthly release cycle, with each
release named after a Perl Mongers group. The March 2013 release is
code-named after Singapore.pm.
Some of the changes in this release are outlined below:
* Rakudo warns when pure expressions are used in sink context
* .substr(...) now correctly accepts whatever-star closures
* Implemented shellwords postcircumfix (%h<< $x 'foo bar' >>)
* Defining operators spelled like the empty string is now illegal
* Array interpolations now properly do LTM
* Autothread "none" and "all" junctions before "any" and "one"
* Helpful error if you write "else if"/"elif" instead of "elsif"
* Throw exception if a Range is used as a Range endpoint
* Corrected argument order in IO.seek
This is only some of the changes in this release. For a more
detailed list, see "docs/ChangeLog".
The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.
The following people contributed to this release:
Jonathan Worthington, kboga, Tobias Leich, Moritz Lenz, Patrick R. Michaud,
Timo Paulssen, Carl Mäsak, Tadeusz Sośnierz, Gerhard R, thundergnat,
TimToady
If you would like to contribute, see <http://rakudo.org/how-to-help>,
ask on the <perl6-compiler@perl.org> mailing list, or ask on IRC
\#perl6 on freenode.
The next release of Rakudo (#63), is scheduled for April 18, 2013.
A list of the other planned release dates and code names for future
releases is available in the "docs/release_guide.pod" file. In
general, Rakudo development releases are scheduled to occur soon after
each Parrot monthly release. Parrot releases the third Tuesday of
each month.
On behalf of the development team, I encourage you to try the new release,
to live life to its fullest, to cherish each moment, and to have fun.
[^1]: What's the difference between the Rakudo compiler and the Rakudo
Star distribution?
The Rakudo compiler is a compiler for the Perl 6 language.
Nothing else.
The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, the most recent incarnation of the "Using
Perl 6" book, and other software that can be used with the Rakudo
compiler to enhance its utility. Rakudo Star is meant for early
adopters who wish to explore what's possible with Rakudo Perl 6 and
provide feedback on what works, what doesn't, and what else they
would like to see included in the distribution.
......@@ -63,12 +63,13 @@ part of monthly Parrot releases.
2012-12-20 Rakudo #59 "Warszawa" (masak)
2013-01-17 Rakudo #60 "Sonoma" (isBEKaml)
2013-02-21 Rakudo #61 "drinkers" (tadzik)
2013-02-23 2013.02.1 (moritz)
2013-03-21 Rakudo #62 "Singapore" (masak)
=head2 Planned 2012 and 2013 releases
Dates are based on Parrot's expected release schedule.
2013-03-21 Rakudo #62
2013-04-18 Rakudo #63
2013-05-23 Rakudo #64
2013-06-20 Rakudo #65
......@@ -128,12 +129,13 @@ the release announcement).
=item *
Create a draft release announcement in docs/announce/YYYY.MM .
Create a draft release announcement in docs/announce/YYYY.MM.md in
markdown format.
You can often use the previous release's file as a starting point,
updating the release number, version information, name, etc. as
appropriate.
$ git add docs/announce/YYYY.MM
$ git add docs/announce/YYYY.MM.md
$ git commit docs
=item *
......
This diff is collapsed.
......@@ -8,10 +8,9 @@ class Perl6::Compiler is HLL::Compiler {
%options<doc> := 'Text';
}
my $hll_ns := pir::get_root_global__Ps('perl6');
my $argiter := nqp::iterator(@args);
nqp::shift($argiter) if $argiter && !nqp::defined(%options<e>);
$hll_ns<$!ARGITER> := $argiter;
nqp::bindhllsym('perl6', '$!ARGITER', $argiter);
my $super := nqp::findmethod(HLL::Compiler, 'command_eval');
my %*COMPILING;
%*COMPILING<%?OPTIONS> := %options;
......@@ -27,7 +26,7 @@ class Perl6::Compiler is HLL::Compiler {
method syntaxcheck($past, *%adverbs) {
if %adverbs<c> {
say("Syntax OK");
pir::exit__0i(0);
nqp::exit(0);
}
$past;
}
......@@ -86,6 +85,6 @@ class Perl6::Compiler is HLL::Compiler {
PERL6LIB=\"lib\" perl6 example.pl
For more information, see the perl6(1) man page.\n");
pir::exit__0i(0);
nqp::exit(0);
}
}
......@@ -26,7 +26,7 @@ class Perl6::ConstantFolder {
my $result := $routine(|@args);
# Add folded symbol into the world (which'll return a PAST ref to it).
$world.add_constant_folded_result(pir::nqp_decontainerize__PP($result))
$world.add_constant_folded_result(nqp::decont($result))
}
else {
nqp::die("No compile time value obtainable");
......
This diff is collapsed.
......@@ -40,6 +40,9 @@ class Perl6::Metamodel::Archetypes {
# filled it before it's useful in some way.
has $!parametric;
# Are we allowed to augment the type?
has $!augmentable;
method nominal() { $!nominal }
method nominalizable() { $!nominalizable }
method inheritable() { $!inheritable }
......@@ -48,4 +51,5 @@ class Perl6::Metamodel::Archetypes {
method composalizable() { $!composalizable }
method generic() { $!generic }
method parametric() { $!parametric }
method augmentable() { $!augmentable }
}
This diff is collapsed.
......@@ -13,15 +13,15 @@ role Perl6::Metamodel::BoolificationProtocol {
if $!boolification_mode == 0 {
my $meth := self.find_method($obj, 'Bool', :no_fallback(1));
if nqp::defined($meth) {
pir::set_boolification_spec__0PiP($obj, 0, $meth)
nqp::setboolspec($obj, 0, $meth)
}
else {
# Default to "not a type object" if we've no available method.
pir::set_boolification_spec__0PiP($obj, 5, nqp::null())
nqp::setboolspec($obj, 5, nqp::null())
}
}
else {
pir::set_boolification_spec__0PiP($obj, $!boolification_mode, nqp::null())
nqp::setboolspec($obj, $!boolification_mode, nqp::null())
}
}
}
......@@ -38,7 +38,7 @@ role Perl6::Metamodel::C3MRO {
unless nqp::can($c.HOW, 'hidden') && $c.HOW.hidden($c) {
my $is_hidden := 0;
for @hidden {
if pir::nqp_decontainerize__PP($c) =:= pir::nqp_decontainerize__PP($_) {
if nqp::decont($c) =:= nqp::decont($_) {
$is_hidden := 1;
}
}
......@@ -75,7 +75,7 @@ role Perl6::Metamodel::C3MRO {
# Is current candidate in the tail? If so, reject.
my $cur_pos := 1;
while $cur_pos <= +$_ {
if pir::nqp_decontainerize__PP($_[$cur_pos]) =:= pir::nqp_decontainerize__PP($cand_class) {
if nqp::decont($_[$cur_pos]) =:= nqp::decont($cand_class) {
$rejected := 1;
}
$cur_pos := $cur_pos + 1;
......@@ -107,7 +107,7 @@ role Perl6::Metamodel::C3MRO {
while $i < +@merge_list {
my @new_list;
for @merge_list[$i] {
unless pir::nqp_decontainerize__PP($_) =:= pir::nqp_decontainerize__PP($accepted) {
unless nqp::decont($_) =:= nqp::decont($accepted) {
@new_list.push($_);
}
}
......
......@@ -31,7 +31,8 @@ class Perl6::Metamodel::ClassHOW
$invoke_forwarder := $f;
}
my $archetypes := Perl6::Metamodel::Archetypes.new( :nominal(1), :inheritable(1) );
my $archetypes := Perl6::Metamodel::Archetypes.new(
:nominal(1), :inheritable(1), :augmentable(1) );
method archetypes() {
$archetypes
}
......@@ -42,12 +43,12 @@ class Perl6::Metamodel::ClassHOW
method new_type(:$name = '<anon>', :$repr = 'P6opaque', :$ver, :$auth) {
my $metaclass := self.new();
my $obj := pir::repr_type_object_for__PPS($metaclass, $repr);
my $obj := nqp::newtype($metaclass, $repr);
self.add_stash($obj);
$metaclass.set_name($obj, $name);
$metaclass.set_ver($obj, $ver) if $ver;
$metaclass.set_auth($obj, $auth) if $auth;
pir::set_boolification_spec__0PiP($obj, 5, nqp::null());
nqp::setboolspec($obj, 5, nqp::null());
$obj
}
......@@ -69,7 +70,7 @@ class Perl6::Metamodel::ClassHOW
# calculate an invokable object.
method add_fallback($obj, $condition, $calculator) {
# Adding a fallback means any method cache is no longer authoritative.
pir::set_method_cache_authoritativeness__vPi($obj, 0);
nqp::setmethcacheauth($obj, 0);
# Add it.
my %desc;
......@@ -197,7 +198,7 @@ class Perl6::Metamodel::ClassHOW
method concretization($obj, $ptype) {
for @!concretizations {
if pir::perl6_decontainerize__PP($_[0]) =:= pir::perl6_decontainerize__PP($ptype) {
if nqp::decont($_[0]) =:= nqp::decont($ptype) {
return $_[1];
}
}
......@@ -224,7 +225,7 @@ class Perl6::Metamodel::ClassHOW
my $junction_type;
my $junction_autothreader;
method setup_junction_fallback($type, $autothreader) {
pir::set_method_cache_authoritativeness__vPi($type, 0);
nqp::setmethcacheauth($type, 0);
$junction_type := $type;
$junction_autothreader := $autothreader;
}
......
......@@ -41,7 +41,7 @@ class Perl6::Metamodel::ConcreteRoleHOW
method new_type(:@roles, :$name = '<anon>', :$ver, :$auth, :$repr) {
my $metarole := self.new(:roles(@roles));
my $obj := pir::repr_type_object_for__PPS($metarole, 'Uninstantiable');
my $obj := nqp::newtype($metarole, 'Uninstantiable');
$metarole.set_name($obj, $name);
$metarole.set_ver($obj, $ver) if $ver;
$metarole.set_auth($obj, $auth) if $auth;
......@@ -105,12 +105,12 @@ class Perl6::Metamodel::ConcreteRoleHOW
}
method type_check($obj, $checkee) {
my $decont := pir::perl6_decontainerize__PP($checkee);
my $decont := nqp::decont($checkee);
if $decont =:= $obj.WHAT {
return 1;
}
for @!role_typecheck_list {
if pir::perl6_decontainerize__PP($_) =:= $decont {
if nqp::decont($_) =:= $decont {
return 1;
}
}
......@@ -120,6 +120,6 @@ class Perl6::Metamodel::ConcreteRoleHOW
method publish_type_cache($obj) {
my @types := [$obj.WHAT];
for @!role_typecheck_list { @types.push($_) }
pir::publish_type_check_cache__0PP($obj, @types)
nqp::settypecache($obj, @types)
}
}
......@@ -22,7 +22,7 @@ class Perl6::Metamodel::ContainerDescriptor {
method instantiate_generic($type_environment) {
my $ins_of := $!of.HOW.instantiate_generic($!of, $type_environment);
my $ins := pir::repr_clone__PP(self);
my $ins := nqp::clone(self);
pir::setattribute__0PPsP($ins, $?CLASS, '$!of', $ins_of)
}
}
......@@ -48,7 +48,7 @@ class Perl6::Metamodel::CurriedRoleHOW
method new_type($curried_role, *@pos_args, *%named_args) {
my $meta := self.new(:curried_role($curried_role), :pos_args(@pos_args),
:named_args(%named_args));
my $type := pir::repr_type_object_for__PPS($meta, 'Uninstantiable');
my $type := nqp::newtype($meta, 'Uninstantiable');
pir::stable_set_type_check_mode__0PI($type, 2)
}
......@@ -103,15 +103,15 @@ class Perl6::Metamodel::CurriedRoleHOW
# that we only want those that have the same parametric role
# as us.
my @cands;
my $crdc := pir::perl6_decontainerize__PP($!curried_role);
my $crdc := nqp::decont($!curried_role);
if nqp::istype($checkee.HOW, self.WHAT) {
if pir::perl6_decontainerize__PP($checkee.HOW.curried_role($checkee)) =:= $crdc {
if nqp::decont($checkee.HOW.curried_role($checkee)) =:= $crdc {
@cands.push($checkee);
}
}
for $checkee.HOW.role_typecheck_list($checkee) {
if nqp::istype($_.HOW, self.WHAT) && !$_.HOW.archetypes.generic {
if pir::perl6_decontainerize__PP($_.HOW.curried_role($_)) =:= $crdc {
if nqp::decont($_.HOW.curried_role($_)) =:= $crdc {
@cands.push($_);
}
}
......
......@@ -78,7 +78,7 @@ class Perl6::Metamodel::MultiDispatcher is Perl6::Metamodel::BaseDispatcher {
my $args := $lexpad<call_sig>;
my $has_invocant := nqp::existskey($lexpad, 'self');
my $invocant := $has_invocant && $lexpad<self>;
my @cands := pir::perl6_get_matching_multis__PPP($disp, $args);
my @cands := $disp.find_best_dispatchee($args, 1);
self.new(:candidates(@cands), :idx(1), :invocant($invocant),
:has_invocant($has_invocant))
}
......@@ -102,7 +102,7 @@ class Perl6::Metamodel::WrapDispatcher is Perl6::Metamodel::BaseDispatcher {
my @cands := self.candidates;
my $i := 0;
while $i < +@cands {
if pir::perl6_decontainerize__PP(@cands[$i]) =:= pir::perl6_decontainerize__PP($wrapper) {
if nqp::decont(@cands[$i]) =:= nqp::decont($wrapper) {
nqp::splice(@cands, [], $i, 1);
return 1;
}
......@@ -112,7 +112,7 @@ class Perl6::Metamodel::WrapDispatcher is Perl6::Metamodel::BaseDispatcher {
}
method enter(*@pos, *%named) {
my $fresh := pir::repr_clone__PP(self);
my $fresh := nqp::clone(self);
my $first := self.candidates[0];
pir::perl6_set_dispatcher_for_callee__vP($fresh);
$first(|@pos, |%named)
......
......@@ -47,7 +47,7 @@ class Perl6::Metamodel::EnumHOW
method new_type(:$name!, :$base_type!) {
my $meta := self.new();
my $obj := pir::repr_type_object_for__PPS($meta, 'P6opaque');
my $obj := nqp::newtype($meta, 'P6opaque');
$meta.set_name($obj, $name);
$meta.set_base_type($meta, $base_type);
self.add_stash($obj);
......
......@@ -20,7 +20,7 @@ class Perl6::Metamodel::GenericHOW
# ourself.
method new_type(:$name) {
my $meta := self.new();
my $obj := pir::repr_type_object_for__PPS($meta, 'Uninstantiable');
my $obj := nqp::newtype($meta, 'Uninstantiable');
$meta.set_name($obj, $name);
$obj
}
......
......@@ -54,9 +54,9 @@ role Perl6::Metamodel::MROBasedMethodDispatch {
%cache{$_.key} := $_.value;
}
pir::publish_method_cache__0PP($obj, %cache);
nqp::setmethcache($obj, %cache);
unless nqp::can(self, 'has_fallbacks') && self.has_fallbacks($obj) {
pir::set_method_cache_authoritativeness__0Pi($obj, $authable);
nqp::setmethcacheauth($obj, $authable);
}
}
}
role Perl6::Metamodel::MROBasedTypeChecking {
method isa($obj, $type) {
my $decont := pir::nqp_decontainerize__PP($type);
my $decont := nqp::decont($type);
for self.mro($obj) {
if pir::nqp_decontainerize__PP($_) =:= $decont { return 1 }
if nqp::decont($_) =:= $decont { return 1 }
}
0
}
......@@ -40,6 +40,6 @@ role Perl6::Metamodel::MROBasedTypeChecking {
}
}
}
pir::publish_type_check_cache__0PP($obj, @tc)
nqp::settypecache($obj, @tc)
}
}
......@@ -12,7 +12,7 @@ role Perl6::Metamodel::MethodContainer {
# Add a method.
method add_method($obj, $name, $code_obj) {
# Adding a method means any cache is no longer authoritative.
pir::set_method_cache_authoritativeness__vPi($obj, 0);
nqp::setmethcacheauth($obj, 0);
# Ensure we haven't already got it.
if nqp::existskey(%!methods, $name) || nqp::existskey(%!submethods, $name) {
......
......@@ -20,7 +20,7 @@ class Perl6::Metamodel::ModuleHOW
method new_type(:$name = '<anon>', :$repr, :$ver, :$auth) {
if $repr { nqp::die("'module' does not support custom representations") }
my $metaclass := self.new();
my $obj := pir::repr_type_object_for__PPS($metaclass, 'Uninstantiable');
my $obj := nqp::newtype($metaclass, 'Uninstantiable');
$metaclass.set_name($obj, $name);
$metaclass.set_ver($obj, $ver) if $ver;
$metaclass.set_auth($obj, $auth) if $auth;
......
......@@ -39,6 +39,7 @@ role Perl6::Metamodel::MultiMethodContainer {
method incorporate_multi_candidates($obj) {
my $num_todo := +@!multi_methods_to_incorporate;
my $i := 0;
my @new_protos;
while $i != $num_todo {
# Get method name and code.
my $name := @!multi_methods_to_incorporate[$i].name;
......@@ -77,6 +78,7 @@ role Perl6::Metamodel::MultiMethodContainer {
my $copy := $dispatcher.derive_dispatcher();
$copy.add_dispatchee($code);
self.add_method($obj, $name, $copy);
nqp::push(@new_protos, $copy);
$found := 1;
}
}
......@@ -92,10 +94,16 @@ role Perl6::Metamodel::MultiMethodContainer {
$proto.set_name($name);
$proto.add_dispatchee($code);
self.add_method($obj, $name, $proto);
nqp::push(@new_protos, $proto);
}
}
$i := $i + 1;
}
for @new_protos {
if nqp::can($_, 'sort_dispatchees') {
$_.sort_dispatchees();
}
}
@!multi_methods_to_incorporate := [];
}
}
......@@ -22,7 +22,7 @@ class Perl6::Metamodel::NativeHOW
method new_type(:$name = '<anon>', :$repr = 'P6opaque', :$ver, :$auth) {
my $metaclass := self.new(:nativesize(0));
my $obj := pir::repr_type_object_for__PPS($metaclass, $repr);
my $obj := nqp::newtype($metaclass, $repr);
$metaclass.set_name($obj, $name);
$metaclass.set_ver($obj, $ver) if $ver;
$metaclass.set_auth($obj, $auth) if $auth;
......
......@@ -19,7 +19,7 @@ class Perl6::Metamodel::PackageHOW
method new_type(:$name = '<anon>', :$repr, :$ver, :$auth) {
if $repr { nqp::die("'package' does not support custom representations") }
my $metaclass := nqp::create(self);
my $obj := pir::repr_type_object_for__PPS($metaclass, 'Uninstantiable');
my $obj := nqp::newtype($metaclass, 'Uninstantiable');
$metaclass.set_name($obj, $name);
self.add_stash($obj);
}
......
......@@ -38,7 +38,7 @@ class Perl6::Metamodel::ParametricRoleGroupHOW
method new_type(:$name!, :$repr) {
my $meta := self.new(:selector($selector_creator()));
my $type_obj := self.add_stash(pir::repr_type_object_for__PPS($meta, 'Uninstantiable'));
my $type_obj := self.add_stash(nqp::newtype($meta, 'Uninstantiable'));
$meta.set_name($type_obj, $name);
$meta.set_boolification_mode($type_obj, 5);
$meta.publish_boolification_spec($type_obj);
......@@ -98,17 +98,17 @@ class Perl6::Metamodel::ParametricRoleGroupHOW
}
method type_check($obj, $checkee) {
my $decont := pir::perl6_decontainerize__PP($checkee);
my $decont := nqp::decont($checkee);
if $decont =:= $obj.WHAT {
return 1;
}
for self.prentending_to_be() {
if $decont =:= pir::perl6_decontainerize__PP($_) {
if $decont =:= nqp::decont($_) {
return 1;
}
}
for @!role_typecheck_list {
if $decont =:= pir::perl6_decontainerize__PP($_) {
if $decont =:= nqp::decont($_) {
return 1;
}
}
......
......@@ -32,7 +32,7 @@ class Perl6::Metamodel::ParametricRoleHOW
method new_type(:$name = '<anon>', :$ver, :$auth, :$repr, :$signatured, *%extra) {
my $metarole := self.new(:signatured($signatured));
my $type := pir::repr_type_object_for__PPS($metarole, 'Uninstantiable');
my $type := nqp::newtype($metarole, 'Uninstantiable');
$metarole.set_name($type, $name);
$metarole.set_ver($type, $ver) if $ver;
$metarole.set_auth($type, $auth) if $auth;
......@@ -108,7 +108,7 @@ class Perl6::Metamodel::ParametricRoleHOW
}
method type_check($obj, $checkee) {
my $decont := pir::perl6_decontainerize__PP($checkee);
my $decont := nqp::decont($checkee);
if $decont =:= $obj.WHAT {
return 1;
}
......@@ -116,7 +116,7 @@ class Perl6::Metamodel::ParametricRoleHOW
return 1;
}
for self.prentending_to_be() {
if $decont =:= pir::perl6_decontainerize__PP($_) {
if $decont =:= nqp::decont($_) {
return 1;
}
}
......
......@@ -3,16 +3,16 @@
# have a my $stash_type and set/get from that.
role Perl6::Metamodel::Stashing {
method set_stash_type($type, $attr_type) {
pir::set_hll_global__1SP('StashType', $type);
pir::set_hll_global__1SP('StashAttrType', $attr_type);
nqp::bindcurhllsym('StashType', $type);
nqp::bindcurhllsym('StashAttrType', $attr_type);
}
method add_stash($type_obj) {
unless nqp::isnull(pir::get_hll_global__Ps('StashType')) {
my $stash_type := pir::get_hll_global__Ps('StashType');
my $attr_type := pir::get_hll_global__Ps('StashAttrType');
unless nqp::isnull(nqp::getcurhllsym('StashType')) {
my $stash_type := nqp::getcurhllsym('StashType');
my $attr_type := nqp::getcurhllsym('StashAttrType');
my $stash := nqp::create($stash_type);
pir::setattribute__vPPsP($stash, $attr_type, '$!storage', my %symbols);
nqp::bindattr($stash, $attr_type, '$!storage', my %symbols);
nqp::setwho($type_obj, $stash);
}
$type_obj
......
......@@ -24,7 +24,7 @@ class Perl6::Metamodel::SubsetHOW
method new_type(:$name = '<anon>', :$refinee!, :$refinement!) {
my $metasubset := self.new(:refinee($refinee), :refinement($refinement));
my $type := pir::repr_type_object_for__PPS($metasubset, 'Uninstantiable');
my $type := nqp::newtype($metasubset, 'Uninstantiable');
$metasubset.set_name($type, $name);
pir::stable_set_type_check_mode__0PI($type, 2)
}
......@@ -35,7 +35,7 @@ class Perl6::Metamodel::SubsetHOW
nqp::die("The 'of' type of a subset must either be a valid nominal " ~
"type or a type that can provide one");
}
$!refinee := pir::nqp_decontainerize__PP($refinee);
$!refinee := nqp::decont($refinee);
}
method refinee($obj) {
......
my $DEBUG := +nqp::atkey(pir::new__Ps('Env'), 'RAKUDO_MODULE_DEBUG');
sub DEBUG(*@strs) {
my $err := pir::getstderr__P();
my $err := nqp::getstderr();
$err.print("MODULE_DEBUG: ");
for @strs { $err.print($_) };
$err.print("\n");
......@@ -12,18 +12,15 @@ class Perl6::ModuleLoader {
my %settings_loaded;
method ctxsave() {
$*MAIN_CTX := Q:PIR {
getinterp $P0
%r = $P0['context';1]
};
$*MAIN_CTX := nqp::ctxcaller(nqp::ctx());
$*CTXSAVE := 0;
}
method search_path() {
# See if we have an @*INC set up, and if so just use that.
my $hll_ns := pir::get_root_global__PS('perl6');
if nqp::existskey($hll_ns, 'PROCESS') && nqp::existskey($hll_ns<PROCESS>.WHO, '@INC') {
my $INC := ($hll_ns<PROCESS>.WHO)<@INC>;
my $PROCESS := nqp::gethllsym('perl6', 'PROCESS');
if !nqp::isnull($PROCESS) && nqp::existskey($PROCESS.WHO, '@INC') {
my $INC := ($PROCESS.WHO)<@INC>;
if nqp::defined($INC) {
my @INC := $INC.FLATTENABLE_LIST();
if +@INC {
......@@ -129,7 +126,7 @@ class Perl6::ModuleLoader {
if +@*MODULES == 0 {
my %prev := nqp::hash();
%prev<line> := $line;
%prev<filename> := pir::find_caller_lex__Ps('$?FILES');
%prev<filename> := nqp::getlexdyn('$?FILES');
@*MODULES[0] := %prev;
}
else {
......@@ -138,7 +135,7 @@ class Perl6::ModuleLoader {
my %trace := nqp::hash();
%trace<module> := $module_name;
%trace<filename> := %chosen<pm>;
my $preserve_global := pir::get_root_global__Ps('perl6'){'GLOBAL'};
my $preserve_global := nqp::ifnull(nqp::gethllsym('perl6', 'GLOBAL'), NQPMu);
nqp::push(@*MODULES, %trace);
if %chosen<load> {
%trace<precompiled> := %chosen<load>;
......@@ -146,7 +143,7 @@ class Perl6::ModuleLoader {
my %*COMPILING := {};
my $*CTXSAVE := self;
my $*MAIN_CTX;
pir::load_bytecode__vs(%chosen<load>);
nqp::loadbytecode(%chosen<load>);
%modules_loaded{%chosen<key>} := $module_ctx := $*MAIN_CTX;
DEBUG("done loading ", %chosen<load>) if $DEBUG;
}
......@@ -171,7 +168,7 @@ class Perl6::ModuleLoader {
# Get the compiler and compile the code, then run it
# (which runs the mainline and captures UNIT).
my $?FILES := %chosen<pm>;
my $eval := pir::compreg__Ps('perl6').compile($source);
my $eval := nqp::getcomp('perl6').compile($source);
my $*CTXSAVE := self;
my $*MAIN_CTX;
$eval();
......@@ -179,9 +176,9 @@ class Perl6::ModuleLoader {
DEBUG("done loading ", %chosen<pm>) if $DEBUG;
}
pir::get_root_global__Ps('perl6'){'GLOBAL'} := $preserve_global;