Skip to content

Commit

Permalink
Constantize empty list / hash in Match
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Nov 2, 2020
1 parent 2ad244b commit 0447b15
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/core.c/Match.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ my class Match is Capture is Cool does NQPMatchRole {
# has $!match; # flag indicating Match object set up (NQPdidMATCH)
# has str $!name; # name if named capture

my Mu $EMPTY_LIST := nqp::list();
my Mu $EMPTY_HASH := nqp::hash();
#?if moar
my constant $EMPTY_LIST = nqp::list();
my constant $EMPTY_HASH = nqp::hash();
#?endif
#?if !moar
my $EMPTY_LIST := nqp::list();
my $EMPTY_HASH := nqp::hash();
#?endif

# When nothing's `made`, we get an NQPMu that we'd like to replace
# with Nil; all Rakudo objects typecheck as Mu, while NQPMu doesn't
Expand Down

0 comments on commit 0447b15

Please sign in to comment.