AFAIK, :$label en :$item are internal to the setting. They’re needed because internally, map is used for for-loops. And for loops can have a label. And need to be told the list they’re getting should be considered an item.
Regarding why .first and .map exist: this is because of the way a backtrace is not really a List, but pretends to be. The .list method vivifies 100 elements (if it can), which basically means that the whole backtrace gets vivified to find e.g. the first non-core setting line. Which is expensive. I think the whole backtrace handling needs to be rethought at some point in time, and probably rewritten from scratch, because at the moment it is a pile of hacks on hacks on hacks. :-( So I’ve made it a &block, as you suggested. Closable with tests, I would say :-) > On 23 Sep 2016, at 02:01, Zoffix Znet (via RT) <perl6-bugs-follo...@perl.org> > wrote: > > # New Ticket Created by Zoffix Znet > # Please include the string: [perl #129334] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=129334 > > > > This .map multi in Backtrace.pm never gets acccessed: > https://github.com/rakudo/rakudo/blob/553cedb679f0f191d2f7341e05033505cb20ac7a/src/core/Backtrace.pm#L282 > > <Zoffix> m: Backtrace.new.map: {...} > <camelia> rakudo-moar 553ced: OUTPUT«Ambiguous call to 'map'; these > signatures all match::(\SELF: █; :$label, :$item, *%_):(Backtrace:D > $: $block, *%_) in block <unit> at <tmp> line 1» > > It seems like merely changing $block to &block in the signature would fix the > issue, but I'm unsure whether :$label and :$item need to be added to it as > well. > > Mentioned on IRC as well: > http://irclog.perlgeek.de/perl6-dev/2016-09-22#i_13260484