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


<TiMBuS> ($!peeraddr, $!peerport) = $peeraddr.split(':', 2); # why
does this assign a Seq to $!peeraddr :/
<masak> rakudo: my ($a, $b); ($a, $b) = "foo:bar:baz".split(':', 2);
say $a; say $b
<p6eval> rakudo bfdd78: OUTPUT«foo␤bar:baz␤»
<masak> rakudo: my ($a, $b); ($a, $b) = "foo:bar:baz".split(':', 2);
say $a.WHAT; say $b.WHAT
<p6eval> rakudo bfdd78: OUTPUT«Str()␤Str()␤»
<masak> worksforme
<TiMBuS> yeah it works there
<TiMBuS> but, not when you use attributes i guess
<masak> rakudo: class A { has $!a; has $!b; method foo { ($!a, $!b) =
"foo:bar:baz".split(':', 2); say $!a.WHAT; say $!b.WHAT } }; A.new.foo
<p6eval> rakudo bfdd78: OUTPUT«Seq()␤Any()␤»
* masak submits rakudobug
<TiMBuS> :/
<TiMBuS> hmm how about slicing it
<masak> rakudo: class A { has $!a; has $!b; method foo { my $seq =
"foo:bar:baz".split(':', 2); $!a = $seq[0]; $!b = $seq[1]; say
$!a.WHAT; say $!b.WHAT } }; A.new.foo
<p6eval> rakudo bfdd78: OUTPUT«Str()␤Str()␤»
<masak> ok.
<masak> so.
<masak> it seems you can't have attributes and list assignment right now.
<TiMBuS> :<

Just to be clear, I'd expect list assignment to regular scalar
variables to work the same as list assignment to scalar attributes.
That is, not Seq(), Any() but Str(), Str().

Reply via email to