Interesting. Still reproducible (2017.11, HEAD(5929887)) On 2015-01-14 03:05:38, FROGGS.de wrote: > FROGGS: m: multi car($x, [$y, @ys] where $x == 1) {1}; say car 1, [1, > [2, 3]]; > camelia: rakudo-moar d69491: OUTPUT«1» > FROGGS: m: multi car($x, [$y, @ys] where $x == $y) {1}; say car 1, [1, > [2, 3]]; > camelia: rakudo-moar d69491: OUTPUT«Cannot call 'infix:<==>'; none of > these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real > \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> > Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» > > And also: > andreoss: m: multi car($x, [$y, @ys] where $x == $y) {1}; say car 1, > [1,2,3]; > camelia: rakudo-moar d69491: OUTPUT«Cannot call 'infix:<==>'; none of > these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real > \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> > Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» > andreoss: could that be a bug? > moritz: m: say 1 == [1, 2, 3] > camelia: rakudo-moar d69491: OUTPUT«False» > moritz: m: multi car($x, [$y, *@ys] where $x == $y) {1}; say car 1, [1, > 2, 3] > camelia: rakudo-moar d69491: OUTPUT«Cannot call 'infix:<==>'; none of > these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real > \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> > Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» > moritz: m: multi car($x, [$y, *@ys] where { $x == $y }) {1}; say car 1, > [1, 2, 3] > camelia: rakudo-moar d69491: OUTPUT«Cannot call 'infix:<==>'; none of > these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real > \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> > Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» > moritz: huh > moritz: m: multi car($x, [$y, *@ys] where { say (:$x, :$y).perl; $x == > $y }) {1}; say car 1, [1, 2, 3] > camelia: rakudo-moar d69491: OUTPUT«("x" => 1, "y" => Mu)Cannot call > 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any > \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D > \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D…» > moritz: m: multi car($x, @ [$y, *@ys] where { say (:$x, :$y).perl; $x > == $y }) {1}; say car 1, [1, 2, 3] > camelia: rakudo-moar d69491: OUTPUT«("x" => 1, "y" => Mu)Cannot call > 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any > \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D > \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D…» > moritz: m: sub f($x, [$y, *@ys]) { say (:$x, :$y, :@ys).perl }; f 1, [2, > 3, 4] > camelia: rakudo-moar d69491: OUTPUT«("x" => 1, "y" => 2, "ys" => [3, 4])» > moritz: m: sub f($x, [$y, *@ys] where { say $y.perl } ) { say (:$x, :$y, > :@ys).perl }; f 1, [2, 3, 4] > camelia: rakudo-moar d69491: OUTPUT«Cannot call method 'perl' on a null > object in sub f at /tmp/UT7XBanYbi:1 in block <unit> at > /tmp/UT7XBanYbi:1» > moritz: andreoss: seems like variables extracted from subsignatures > aren't available in where-blocks > moritz: andreoss: and yes, that's a bug
[perl #123596] vars from subsigs are not available to where blocks
Aleks-Daniel Jakimenko-Aleksejev via RT Fri, 01 Dec 2017 11:02:20 -0800