How does Perl 6's multi dispatch decide which routine to use?
Consider this program where I construct an Array in the argument list. Although there's a signature that accepts an Array, this calls the one that accepts a List: foo( [ 1, 2, 3 ] ); multi foo ( Array @array ) { put "Called Array @ version" } multi foo ( Array $array ) { put "Called Array \$ version" } multi foo ( List $list ) { put "Called List version" } multi foo ( Range $range ) { put "Called Range version" } I get the output from an unexpected routine: Called Array $ version If I uncomment that other signature, that one is called: Called List version Why doesn't it call the ( Array @array