On Thu, 19 Jun 2014 17:45:23 -0700, elizabeth wrote:
> Additional finds:
>
> [19:24:52] <timotimo> m: my @a; my $c = 1; @a.push: $($c,1); $c =
> "hi"; @a.push: $($c,2); say @a.perl
> [19:24:53] <+camelia> rakudo-moar 8812ca: OUTPUT«Array.new($("hi",
> 1), $("hi", 2))»
> [19:25:09] <timotimo> it would appear the container of the $c is
> being pushed, rather than the value?
> [19:26:56] <Mouq> It's not the fact that it's being pushed,
> it's the building of $($c, 1), isn't it?
> [19:27:14] <timotimo> could very well be
> [19:27:19] <timotimo> is that being done at compile-time perhaps?
> [19:27:29] <Mouq> m: my $c = 1; my \b = $($c, 1); $c = Int; say
> b.perl
> [19:27:31] <+camelia> rakudo-moar 8812ca: OUTPUT«$(Int, 1)»
> [19:27:39] <Mouq> m: my $c = 1; my $b = $($c, 1); $c = Int; say
> $b.perl
> [19:27:40] <+camelia> rakudo-moar 8812ca: OUTPUT«$(Int, 1)»
> [19:28:22] <timotimo> no, the optimizer leaves that alone.
> [19:29:22] <Mouq> m: my $c = 1; my $b = ($c, 1); $c = Int; say
> $b.perl
> [19:29:23] <+camelia> rakudo-moar 8812ca: OUTPUT«$(Int, 1)»
> [19:29:30] <Mouq> m: my $c = 1; my $b = [$c, 1]; $c = Int; say
> $b.perl
> [19:29:31] <+camelia> rakudo-moar 8812ca: OUTPUT«[1, 1]»
> [19:30:37] <Mouq> m: my $c = 1; my $b = Array.new($c, 1); $c =
> Int; say $b.perl
> [19:30:38] <+camelia> rakudo-moar 8812ca: OUTPUT«[Int, 1]»
> [19:30:44] <Mouq> Many WTFs to be had
> [19:31:33] <Mouq> p6: my $c = 1; my $b = Array.new($c, 1); $c =
> Int; say $b.perl
> [19:31:38] <+camelia> niecza v24-109-g48a8de3: OUTPUT«Unhandled
> exception: Excess arguments to List.new, used 1 of 3 positionals at
> /home/p6eval/niecza/lib/CORE.setting line 0 (List.new @ 1)  at
> /tmp/tmpfile line 1 (mainline @ 4)  at
> /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) …»
> [19:31:38] <+camelia> ..rakudo-{parrot,jvm,moar} 8812ca:
> OUTPUT«[Int, 1]»
> [19:31:51] <Mouq> n: my $c = 1; my $b = ($c, 1); $c = Int; say
> $b.perl
> [19:31:53] <+camelia> niecza v24-109-g48a8de3: OUTPUT«$(Int, 1)»
> [19:33:07] <Mouq> OTOH, ($c,) having the container is the only
> way ($c, *) = * could work
> [19:33:21] <Mouq> Other than special-casing
> [19:34:32] <timotimo> that's true
> [19:35:03] <timotimo> m: my $c; say $($c, 1).WHAT
> [19:35:03] <+camelia> rakudo-moar 8812ca: OUTPUT«(Parcel)»
> [19:35:07] <timotimo> ah, it's a parcel
> [19:35:18] <timotimo> those are supposed to be internal-ish magic-
> ish any way
> [19:35:36] <timotimo> to be honest, i'd rather use [ ] for nested
> structures
> [20:39:20] <lizmat> Mouq: it has nothing to do with .push (or
> unshift): it has to do with Parcel generation:
> [20:39:23] <lizmat> r: my $c=42; my $a = $($c,1); $c=43; my $b =
> $($c,2); .perl.say for $a, $b
> [20:39:27] <+camelia> rakudo-{parrot,jvm,moar} 8812ca: OUTPUT«$(43,
> 1)$(43, 2)»
> [20:40:03] <lizmat> r: my $c=42; my $a = $(+$c,1); $c=43; my $b =
> $(+$c,2); .perl.say for $a, $b
> [20:40:06] <+camelia> rakudo-{parrot,jvm,moar} 8812ca: OUTPUT«$(42,
> 1)$(43, 2)»
> [20:40:20] <lizmat> r: my $c=42; my $a = $($c,1); $c=43; my $b =
> $(+$c,2); .perl.say for $a, $b
> [20:40:24] <+camelia> rakudo-{parrot,jvm,moar} 8812ca: OUTPUT«$(43,
> 1)$(43, 2)»
> [20:40:39] <lizmat> r: my $c=42; my $a = $(+$c,1); $c=43; my $b =
> $($c,2); .perl.say for $a, $b
> [20:40:43] <+camelia> rakudo-{parrot,jvm,moar} 8812ca: OUTPUT«$(42,
> 1)$(43, 2)»
> [20:42:36] <lizmat> ah, timotimo and Mouq already established
> that :-)
I don't see anything that looks out of sorts with our current
post-GLR semantics. Should this (very old) ticket just be retired now?