Skip to content

Commit

Permalink
Turn candidates_matching into cando.
Browse files Browse the repository at this point in the history
Turns out we had a non-spec method that was really close to doing what
a spec'd method needed. Small refactor, including to the thing that
depended on it.
  • Loading branch information
jnthn committed Nov 6, 2012
1 parent 0a320a4 commit da339d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/Main.pm
Expand Up @@ -124,7 +124,7 @@ my sub MAIN_HELPER($retval = 0) is hidden_from_backtrace {
my $?USAGE = gen-usage();

# Get a list of candidates that match according to the dispatcher
my @matching_candidates = $m.candidates_matching(|@($p), |%($n));
my @matching_candidates = $m.cando(Capture.new(list => $p, hash => $n));
# Sort out all that would fail due to binding
@matching_candidates .=grep: {!has-unexpected-named-arguments($_.signature, $n)};
# If there are still some candidates left, try to dispatch to MAIN
Expand Down
4 changes: 2 additions & 2 deletions src/core/Routine.pm
Expand Up @@ -25,7 +25,7 @@ my class Routine {
(self,)
}

method candidates_matching(|c) {
method cando(Capture $c) {
my $disp;
if self.is_dispatcher {
$disp := self;
Expand All @@ -39,7 +39,7 @@ my class Routine {
my Mu $cap := pir::find_lex__Ps('call_sig');
pir::perl6ize_type__PP(pir::perl6_get_matching_multis__PPP($disp, $cap))
}
checker(|c);
checker(|$c);
}

method multi() {
Expand Down

0 comments on commit da339d2

Please sign in to comment.