# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #116096]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=116096 >

<sahadev> r: say ([1, 2], [3, 4]).perl
<p6eval> rakudo fc9c3b: OUTPUT«([1, 2], [3, 4])␤»
<sahadev> r: say set([1, 2], [1, 2]).perl
<p6eval> rakudo fc9c3b: OUTPUT«set("1", "2")␤»
<sahadev> r: say set(([1, 2], [3, 4])).perl
<p6eval> rakudo fc9c3b: OUTPUT«set("1", "2", "3", "4")␤»
<sahadev> how do I prevent the list of lists from being flattened when
passed to set()?
<jnthn> Preventing it probably means "fix Rakudo"...
<jnthn> sub set(*@args) {
<jnthn> Should that be **@args?
<jnthn> r: say Set.new([1, 2], [1, 2]).perl
<p6eval> rakudo fc9c3b: OUTPUT«set("1", "2")␤»
<jnthn> Hm, but method new also does *@args
* jnthn ain't sure off hand
<jnthn> TimToady: ^^ if you have a moment :)
<TimToady> [] should not be flattening in list context, and () should
be transparent to list context
<TimToady> r: my $a = [1,2]; my $b = [3,4]; say set($a,$b).perl
<p6eval> rakudo fc9c3b: OUTPUT«set("1", "2", "3", "4")␤»
<TimToady> if Set.new is unwrapping Set items into elements, that's wrong
<TimToady> otherwise we can't create a set of sets...
<jnthn> TimToady: Figured that'd be the answer
<jnthn> masak: feel free to file ;)
* masak submits rakudobug
<jnthn> Oh wait
* masak waits
<jnthn> r: sub foo(*@x) { say @x.perl }; foo([1,2], [3,4])
<p6eval> rakudo fc9c3b: OUTPUT«Array.new([1, 2], [3, 4])␤»
<jnthn> ah, ok, that is OK
<jnthn> so it's just a set bug
<jnthn> masak: file ahead, just wanted to be sure it wasn't a more
general problem :)
* masak files ahead

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-compiler @
postedDec 14, '12 at 9:47p
activeDec 14, '12 at 9:47p

1 user in discussion

Carl Mäsak: 1 post



site design / logo © 2018 Grokbase