diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index 466cb9ba6c5..29ebf92cf75 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -2848,7 +2848,7 @@ class Perl6::Actions is HLL::Actions { # steals spaces after a postfixish. Thus "$a $b" would get messed up. # Here we take them back again. Hacky, better solutions welcome. sub steal_back_spaces($/, $expr) { - my $pos := pir::length__IS($/) - 1; + my $pos := nqp::chars($/) - 1; while pir::is_cclass__IISI(32, $/, $pos) { $pos--; } @@ -3320,7 +3320,7 @@ class Perl6::Actions is HLL::Actions { # the $usage parameter to make it more helpful. sub compile_time_value_str($past, $usage, $/) { if $past { - pir::repr_unbox_str__SP($past); + nqp::unbox_s($past); } else { $/.CURSOR.panic("$usage must have a value known at compile time"); diff --git a/src/Perl6/Grammar.pm b/src/Perl6/Grammar.pm index 55e4b560653..a799f559d53 100644 --- a/src/Perl6/Grammar.pm +++ b/src/Perl6/Grammar.pm @@ -1730,7 +1730,7 @@ grammar Perl6::Grammar is HLL::Grammar { sub bracket_ending($matches) { my $check := $matches[+$matches - 1]; my $str := $check.Str; - my $last := pir::substr($str, pir::length__IS($check) - 1, 1); + my $last := pir::substr($str, nqp::chars($check) - 1, 1); $last eq ')' || $last eq '}' || $last eq ']' || $last eq '>' } diff --git a/src/Perl6/Metamodel/BOOTSTRAP.pm b/src/Perl6/Metamodel/BOOTSTRAP.pm index 9545ac04a3e..3bf99eea3d7 100644 --- a/src/Perl6/Metamodel/BOOTSTRAP.pm +++ b/src/Perl6/Metamodel/BOOTSTRAP.pm @@ -46,15 +46,15 @@ Mu.HOW.add_parrot_vtable_mapping(Mu, 'get_bool', sub ($self) { $self.Bool() }); Mu.HOW.add_parrot_vtable_mapping(Mu, 'get_integer', sub ($self) { - pir::repr_unbox_int__IP($self.Int()) + nqp::unbox_i($self.Int()) }); Mu.HOW.add_parrot_vtable_mapping(Mu, 'get_number', sub ($self) { - pir::repr_unbox_num__NP($self.Num()) + nqp::unbox_n($self.Num()) }); Mu.HOW.add_parrot_vtable_mapping(Mu, 'get_string', sub ($self) { - pir::repr_unbox_str__SP($self.Str()) + nqp::unbox_s($self.Str()) }); Mu.HOW.add_parrot_vtable_mapping(Mu, 'defined', sub ($self) { pir::istrue__IP($self.defined()) }); diff --git a/src/Perl6/Module/Loader.pm b/src/Perl6/Module/Loader.pm index 8cdbae934e8..fa3b34ace7d 100644 --- a/src/Perl6/Module/Loader.pm +++ b/src/Perl6/Module/Loader.pm @@ -30,7 +30,7 @@ method need($name, %name_adverbs?) { # Need not load file if we already did so. unless %LOADED{$pm_file} { # Is there a pre-compiled PIR version? - my $pir_file := pir::substr__SSII($pm_file, 0, pir::index__ISSi($pm_file, '.', pir::length__IS($pm_file)-4)) ~ '.pir'; + my $pir_file := pir::substr__SSII($pm_file, 0, pir::index__ISSi($pm_file, '.', nqp::chars($pm_file)-4)) ~ '.pir'; my $loaded_pir := 0; # stat[7]: modifytime if pir::stat__ISI($pir_file, 0) diff --git a/src/Perl6/Module/Locator.pm b/src/Perl6/Module/Locator.pm index ac3ce2b9447..83327099fee 100644 --- a/src/Perl6/Module/Locator.pm +++ b/src/Perl6/Module/Locator.pm @@ -8,29 +8,29 @@ method find_candidates($lookfor, @inc) { my @dirs := pir::split__PSS('::', $lookfor); my $file := @dirs.pop(); my $localpath := +@dirs ?? pir::join__SSP('/', @dirs) ~ '/' !! ''; - # pir::say("\nlookfor: $lookfor\nlocalpath: $localpath\nfile: $file"); + # nqp::say("\nlookfor: $lookfor\nlocalpath: $localpath\nfile: $file"); # within each @inc path look for "$localpath/$file.pm" my @candidates; for @inc { my $path := "$_/$localpath"; - # pir::say(" path: $path"); - my $check_path := pir::substr__SSII($path, 0, pir::length__IS($path) - 1); + # nqp::say(" path: $path"); + my $check_path := pir::substr__SSII($path, 0, nqp::chars($path) - 1); if pir::stat__ISI($check_path, 0) && pir::stat__ISI($check_path, 2) { my @dir := pir::new__PS('OS').readdir($path); my $candidate := ""; for @dir { - # pir::say(" readdir: $_"); - if pir::substr__SSII($_, 0, pir::length__IS($file) + 1) eq $file ~ '.' { - if pir::substr__SSII($_, pir::length__IS($_) - 4, 4) eq '.pm6' || - !$candidate && pir::substr__SSII($_, pir::length__IS($_) - 3, 3) eq '.pm' { + # nqp::say(" readdir: $_"); + if pir::substr__SSII($_, 0, nqp::chars($file) + 1) eq $file ~ '.' { + if pir::substr__SSII($_, nqp::chars($_) - 4, 4) eq '.pm6' || + !$candidate && pir::substr__SSII($_, nqp::chars($_) - 3, 3) eq '.pm' { $candidate := "$path$_"; } } } if $candidate { @candidates.push($candidate); - # pir::say(" found: $candidate"); + # nqp::say(" found: $candidate"); } } } diff --git a/src/core/Array.pm b/src/core/Array.pm index bb7289df41b..eb3c0d9fc27 100644 --- a/src/core/Array.pm +++ b/src/core/Array.pm @@ -23,7 +23,7 @@ class Array { method STORE(|$) { # get arguments, shift off invocant my $args := pir::perl6_current_args_rpa__P(); - pir::shift__PP($args); + nqp::shift($args); # clear our current items, and create a flattening iterator # that will bring in values from $args pir::setattribute__vPPsP(self, List, '$!items', Mu); diff --git a/src/core/Cool.pm b/src/core/Cool.pm index ca852002b53..84ca6203009 100644 --- a/src/core/Cool.pm +++ b/src/core/Cool.pm @@ -4,7 +4,7 @@ my class Cool { } method chars() { - nqp::p6box_i(pir::length__IS(nqp::unbox_s(self.Str))); + nqp::p6box_i(nqp::chars(nqp::unbox_s(self.Str))); } method substr($start as Int, $length?) { @@ -29,11 +29,11 @@ my class Cool { } method uc() { - nqp::p6box_s(pir::upcase__SS(nqp::unbox_s(self.Str))) + nqp::p6box_s(nqp::uc(nqp::unbox_s(self.Str))) } method lc() { - nqp::p6box_s(pir::downcase__SS(nqp::unbox_s(self.Str))) + nqp::p6box_s(nqp::lc(nqp::unbox_s(self.Str))) } method ucfirst() { @@ -47,7 +47,7 @@ my class Cool { } method ord() { - nqp::p6box_i(pir::ord__IS(nqp::unbox_s(self.Str))) + nqp::p6box_i(nqp::ord(nqp::unbox_s(self.Str))) } method flip() { @@ -56,7 +56,7 @@ my class Cool { proto method index(|$) {*} multi method index(Cool \$needle, Cool $pos = 0) { - my $result := nqp::p6box_i(pir::index__ISSI( + my $result := nqp::p6box_i(nqp::index( nqp::unbox_s(self.Str), nqp::unbox_s($needle.Str), nqp::unbox_i($pos.Int) diff --git a/src/core/EnumMap.pm b/src/core/EnumMap.pm index d7bdde5cfb5..6e26c088def 100644 --- a/src/core/EnumMap.pm +++ b/src/core/EnumMap.pm @@ -5,7 +5,7 @@ my class EnumMap { method exists(Str \$key) { nqp::p6bool( pir::defined($!storage) - && pir::exists__IQs($!storage, nqp::unbox_s($key)) + && nqp::existskey($!storage, nqp::unbox_s($key)) ) } @@ -20,7 +20,7 @@ my class EnumMap { my Mu $iter := pir::iter__PP($!storage); my Mu $pair; while $iter { - $pair := pir::shift__PP($iter); + $pair := nqp::shift($iter); take Pair.new(:key($pair.key), :value($pair.value)); } } @@ -28,7 +28,7 @@ my class EnumMap { method at_key(Str \$key) { self.exists($key) - ?? pir::set__PQs($!storage, nqp::unbox_s($key)) + ?? nqp::atkey($!storage, nqp::unbox_s($key)) !! Any } diff --git a/src/core/IO.pm b/src/core/IO.pm index f5c12a073cf..3e7f0f50624 100644 --- a/src/core/IO.pm +++ b/src/core/IO.pm @@ -1,7 +1,7 @@ # XXX Relatively cheaty, just to get us able to output something. # But you should see what USED to be here! O.O sub print(*@list) { - pir::print(@list.shift) while @list.gimme(1); + nqp::print(@list.shift) while @list.gimme(1); 1.Bool } diff --git a/src/core/List.pm b/src/core/List.pm index e7184fa1768..a8069d8d74d 100644 --- a/src/core/List.pm +++ b/src/core/List.pm @@ -16,7 +16,7 @@ class List { method at_pos(\$pos) { self.exists($pos) - ?? pir::set__PQi($!items, nqp::unbox_i($pos)) + ?? nqp::atpos($!items, nqp::unbox_i($pos)) !! Mu } @@ -31,7 +31,7 @@ class List { method exists(\$pos) { self.gimme($pos + 1); - nqp::p6bool(pir::exists__IQI($!items, nqp::unbox_i($pos))) + nqp::p6bool(nqp::existspos($!items, nqp::unbox_i($pos))) } method flat() { @@ -76,7 +76,7 @@ class List { method munch($n is copy) { self.gimme($n); my Mu $rpa := pir::new__Ps('ResizablePMCArray'); - pir::push__vPP($rpa, pir::shift__PP($!items)) + pir::push__vPP($rpa, nqp::shift($!items)) while $!items && $n-- > 0; pir__perl6_box_rpa__PP($rpa) } @@ -89,7 +89,7 @@ class List { method shift() { # make sure we have at least one item, then shift+return it - self.gimme(1) && pir::shift__PP($!items) + self.gimme(1) && nqp::shift($!items) } multi method perl(List:D \$self:) { @@ -99,7 +99,7 @@ class List { } method STORE_AT_POS(\$pos, Mu \$v) { - pir::set__1QiP($!items, nqp::unbox_i($pos), $v) + nqp::bindpos($!items, nqp::unbox_i($pos), $v) } method RPA() { diff --git a/src/core/ListIter.pm b/src/core/ListIter.pm index 4eea79bbb9b..5a3760eabfd 100644 --- a/src/core/ListIter.pm +++ b/src/core/ListIter.pm @@ -13,7 +13,7 @@ my class ListIter { my $flattens = $!list.defined && $!list.flattens; my $eager = Whatever.ACCEPTS($n); while $!rest && ($eager || $n > 0) { - $x := pir::set__PQi($!rest, 0); + $x := nqp::atpos($!rest, 0); if pir::not__II(pir::is_container__IP($x)) && $x.defined && Iterable.ACCEPTS($x) { last if $eager && $x.infinite; @@ -29,9 +29,9 @@ my class ListIter { pir__perl6_unbox_rpa__PP($x), 0, 1); } - elsif Nil.ACCEPTS($x) { pir::shift__PP($!rest) } + elsif Nil.ACCEPTS($x) { nqp::shift($!rest) } else { - pir::shift__PP($!rest); + nqp::shift($!rest); $x := $!list.STORE_AT_POS($pos, $x) if $!list.defined; pir::push__vPP($rpa, $x); $eager or $n = $n - 1; @@ -55,8 +55,8 @@ my class ListIter { method infinite() { $!rest - ?? Iterable.ACCEPTS(pir::set__PQi($!rest,0)) - && pir::set__PQi($!rest,0).infinite + ?? Iterable.ACCEPTS(nqp::atpos($!rest,0)) + && nqp::atpos($!rest,0).infinite || Mu !! 0.Bool } @@ -79,9 +79,9 @@ my class ListIter { # we leave these here for documentation purposes. # sub pir::perl6_list_from_rpa__PPPP(|$) { # my $args := pir::perl6_current_args_rpa__P(); -# my $type := pir::shift__PP($args); -# my Mu $rpa := pir::shift__PP($args); -# my $flattens := pir::shift__PP($args); +# my $type := nqp::shift($args); +# my Mu $rpa := nqp::shift($args); +# my $flattens := nqp::shift($args); # # my $list := pir::repr_instance_of__PP($type); # pir::setattribute__vPPsP($list, $type, '$!flattens', $flattens); @@ -92,8 +92,8 @@ my class ListIter { # # sub pir::perl6_iter_from_rpa__PPP(|$) { # my $args := pir::perl6_current_args_rpa__P(); -# my Mu $rpa := pir::shift__PP($args); -# my $list := pir::shift__PP($args); +# my Mu $rpa := nqp::shift($args); +# my $list := nqp::shift($args); # # pir::setattribute__0PPsP( # pir::setattribute__0PPsP( diff --git a/src/core/Mu.pm b/src/core/Mu.pm index a84b4cabab2..98d413a5b29 100644 --- a/src/core/Mu.pm +++ b/src/core/Mu.pm @@ -60,14 +60,14 @@ my class Mu { sub DUMP(|$) { my Mu $args := pir::perl6_current_args_rpa__P(); - my Mu $topic := pir::shift__PP($args); + my Mu $topic := nqp::shift($args); if pir::isnull__IP($topic) { '(null)' } elsif pir::isa__IPs($topic, 'ResizablePMCArray') { my $s = 'RPA<' ~ nqp::p6box_s(pir::get_addr__IP($topic)) ~ '>('; my $t = ''; $topic := pir::clone__PP($topic); while $topic { - my Mu $x := pir::shift__PP($topic); + my Mu $x := nqp::shift($topic); $s = $s ~ $t ~ DUMP($x); $t = ', '; } diff --git a/src/core/Parcel.pm b/src/core/Parcel.pm index a147634f3fe..c9f8266f9dc 100644 --- a/src/core/Parcel.pm +++ b/src/core/Parcel.pm @@ -12,7 +12,7 @@ my class Parcel { multi method gist(Parcel:D:) { my @gist; my Mu $rpa := pir::clone__PP($!storage); - @gist.push( pir::shift__PP($rpa).gist ) while $rpa; + @gist.push( nqp::shift($rpa).gist ) while $rpa; @gist; } @@ -20,9 +20,9 @@ my class Parcel { my Mu $rpa := pir::clone($!storage); my $perl = '('; if $rpa { - $perl = $perl ~ pir::shift__PP($rpa).perl; + $perl = $perl ~ nqp::shift($rpa).perl; if $rpa { - $perl = $perl ~ ', ' ~ pir::shift__PP($rpa).perl while $rpa; + $perl = $perl ~ ', ' ~ nqp::shift($rpa).perl while $rpa; } else { $perl = $perl ~ ','; @@ -65,7 +65,7 @@ sub pir__perl6_box_rpa__PP(|$) { pir::repr_instance_of__PP(Parcel), Parcel, '$!storage', - pir::shift__PP(pir::perl6_current_args_rpa__P())) + nqp::shift(pir::perl6_current_args_rpa__P())) } sub pir__perl6_unbox_rpa__PP(\$parcel) { diff --git a/src/core/Str.pm b/src/core/Str.pm index 57020d222dc..a5e38db387c 100644 --- a/src/core/Str.pm +++ b/src/core/Str.pm @@ -37,27 +37,27 @@ multi infix:<~>(Str \$a, Str \$b) { } multi infix:(Str \$a, Str \$b) { - nqp::p6bool(pir::iseq__ISS(nqp::unbox_s($a), nqp::unbox_s($b))) + nqp::p6bool(nqp::iseq_s(nqp::unbox_s($a), nqp::unbox_s($b))) } multi infix:(Str \$a, Str \$b) { - nqp::p6bool(pir::isne__ISS(nqp::unbox_s($a), nqp::unbox_s($b))) + nqp::p6bool(nqp::isne_s(nqp::unbox_s($a), nqp::unbox_s($b))) } multi infix:(Str \$a, Str \$b) { - nqp::p6bool(pir::islt__ISS(nqp::unbox_s($a), nqp::unbox_s($b))) + nqp::p6bool(nqp::islt_s(nqp::unbox_s($a), nqp::unbox_s($b))) } multi infix:(Str \$a, Str \$b) { - nqp::p6bool(pir::isle__ISS(nqp::unbox_s($a), nqp::unbox_s($b))) + nqp::p6bool(nqp::isle_s(nqp::unbox_s($a), nqp::unbox_s($b))) } multi infix:(Str \$a, Str \$b) { - nqp::p6bool(pir::isgt__ISS(nqp::unbox_s($a), nqp::unbox_s($b))) + nqp::p6bool(nqp::isgt_s(nqp::unbox_s($a), nqp::unbox_s($b))) } multi infix:(Str \$a, Str \$b) { - nqp::p6bool(pir::isge__ISS(nqp::unbox_s($a), nqp::unbox_s($b))) + nqp::p6bool(nqp::isge_s(nqp::unbox_s($a), nqp::unbox_s($b))) }