Permalink
Browse files

Turn candidates_matching into cando.

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...
1 parent 0a320a4 commit da339d2626a291c3e895bb435542c52b4aa6c442 @jnthn jnthn committed Nov 6, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/core/Main.pm
  2. +2 −2 src/core/Routine.pm
View
@@ -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
View
@@ -25,7 +25,7 @@ my class Routine {
(self,)
}
- method candidates_matching(|c) {
+ method cando(Capture $c) {
my $disp;
if self.is_dispatcher {
$disp := self;
@@ -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() {

0 comments on commit da339d2

Please sign in to comment.