From 87226876a2d06c8b6ac9cedece31be12ef89e34d Mon Sep 17 00:00:00 2001 From: Daniel Green Date: Sat, 21 Mar 2020 19:10:56 -0400 Subject: [PATCH] Convert `nqp::istrue` into `nqp::elems` See https://github.com/Raku/nqp/commit/6239081e9531e56cdb75c5a17d59299b0cd1fcbe for context. --- src/Perl6/World.nqp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Perl6/World.nqp b/src/Perl6/World.nqp index f4eab82d7f8..45b7029fd64 100644 --- a/src/Perl6/World.nqp +++ b/src/Perl6/World.nqp @@ -4695,7 +4695,7 @@ class Perl6::World is HLL::World { if $name { @components.push(~$name); } - if $name { + if nqp::existskey($name, 'morename') && nqp::elems($name) { for $name { if $_ { @components.push(~$_); @@ -4707,7 +4707,7 @@ class Perl6::World is HLL::World { else { # Either it's :: as a name entirely, in which case it's anon, # or we're ending in ::, in which case it implies .WHO. - if +@components { + if nqp::elems(@components) { nqp::bindattr_i($result, LongName, '$!get_who', 1); } } @@ -4719,7 +4719,7 @@ class Perl6::World is HLL::World { # the last part of the name (e.g. for infix:<+>). Need to be a # little cheaty when compiling the setting due to bootstrapping. my @pairs; - if $longname { + if nqp::existskey($longname, 'colonpair') && nqp::elems($longname) { for $longname { if $_ && !$_ { my $cp_str; @@ -4749,8 +4749,8 @@ class Perl6::World is HLL::World { $cp_str := self.canonicalize_pair('',self.compile_time_evaluate: $_, $_.ast, :mark-wanted); } - if +@components { - @components[+@components - 1] := @components[+@components - 1] ~ $cp_str; + if nqp::elems(@components) { + @components[nqp::elems(@components) - 1] := @components[nqp::elems(@components) - 1] ~ $cp_str; } else { @components[0] := $cp_str; }