# New Ticket Created by David Warring # Please include the string: [perl #122708] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=122708 >
This issues was raised on SO http://stackoverflow.com/questions/25669107/when-can-i-use-the-whatever-star and has been discussed on #perl6 IRC. The conclusion is that this behavior, although to spec, is a POL (Principle of Least Astonishment) bug. [07:55] * dwarring looking at http://stackoverflow.com/questions/25669107/when-can-i-use-the-whatever-star [07:56] <dwarring> '* + 2' curries, but '* min 2' doesn't [07:56] <colomon> really? [07:57] <dwarring> m: say * + 2 [07:57] <+camelia> rakudo-moar fd9238: OUTPUT«WhateverCode.new()» [07:57] <dwarring> m: say * min 2 [07:57] <+camelia> rakudo-moar fd9238: OUTPUT«2» [07:57] <dwarring> yep [07:57] <FROGGS> m: say * max 2 [07:57] <+camelia> rakudo-moar fd9238: OUTPUT«*» [07:57] <dwarring> say min 10, 12, 42, 3 [07:57] <FROGGS> so it becomes Inf-ish? [07:57] <dwarring> say 3 min 4 [07:58] <dwarring> m: say 3 min 4 [07:58] <+camelia> rakudo-moar fd9238: OUTPUT«3» [07:58] <colomon> where's that list of non-WhateverCode operators? [07:58] <dwarring> min can be used as an infix [07:59] <colomon> n: say * min 2 [07:59] <+camelia> niecza v24-109-g48a8de3: OUTPUT«{ ... }» [07:59] <dwarring> but isn't currying as such [07:59] <colomon> I think this might be a rakudobug? [07:59] <FROGGS> perhaps it checks for an existing sub before it checks for infixes? [07:59] <FROGGS> (just guessing) [07:59] <colomon> p6: say (1..20).map(* min 3) [08:00] <dwarring> something to do with the signature (also guessing) [08:00] <+camelia> rakudo-jvm fd9238: OUTPUT«(timeout)» [08:00] <+camelia> ..rakudo-parrot fd9238: OUTPUT«No such method 'count' for invocant of type 'Int' in method reify at gen/parrot/CORE.setting:7892 in method reify at gen/parrot/CORE.setting:7808 in method reify at gen/parrot/CORE.setting:7808 in method reify at gen/parrot/CORE.setting:7…» [08:00] <+camelia> ..rakudo-moar fd9238: OUTPUT«No such method 'count' for invocant of type 'Int' in method reify at src/gen/m-CORE.setting:7943 in method reify at src/gen/m-CORE.setting:7855 in method reify at src/gen/m-CORE.setting:7855 in method reify at src/gen/m-CORE.setting:7956…» [08:00] <+camelia> ..niecza v24-109-g48a8de3: OUTPUT«1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3» [08:00] <colomon> http://perlcabal.org/syn/S02.html#Operators_with_idiosyncratic_Whatever [08:01] <colomon> I don't see any reason this list should also include min / max? [08:01] * TimToady sees no signatures with * offhand [08:02] <lizmat> m: say (1..20).map: { $_ min 3 } # works ok [08:02] <+camelia> rakudo-moar fd9238: OUTPUT«1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3» [08:04] * grondilu notices that Digest still does not pass all tests and looks into it ... [08:06] <lizmat> well, at any case, that error for say (1..20).map(* min 3) is LTA ... [08:09] <dwarring> ^^ does this deserve a ticket (* min 2 not currying) [08:09] <colomon> I guess (reading over it again) the spec question is, should infix:<min> be "Whatever-aware"? [08:09] <colomon> I can't think of any reason it should, but maybe there's something I'm missing here. [08:10] <grondilu> retupmoca++ [08:13] <TimToady> I'd call it a POLA bug [08:13] <TimToady> something is treating min as if it were a range [08:13] <lizmat> POLA? [08:14] <TimToady> just like POLS, only differnet [08:14] <colomon> POLS? [08:14] <TimToady> s/Surprise/Astonishment/