Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment to several declared SSA-style \x variables fails in Rakudo #3763

Closed
p6rt opened this issue Mar 30, 2015 · 5 comments
Closed

Assignment to several declared SSA-style \x variables fails in Rakudo #3763

p6rt opened this issue Mar 30, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Mar 30, 2015

Migrated from rt.perl.org#124210 (status was 'resolved')

Searchable as RT124210$

@p6rt
Copy link
Author

p6rt commented Mar 30, 2015

From @masak

<TimToady> m​: my (\a,\b) = 1,2; say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«(Any)␤»
<TimToady> seems like a bug
* masak submits rakudobug
<jnthn> That should either DWYM or whine, I guess.
<TimToady> m​: my (\a,\b) := \(1,2); say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«(Any)␤»
<TimToady> m​: my (\a,\b) :​:= \(1,2); say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«(Any)␤»
<jnthn> OK, *that* one certainly should work.
<jnthn> The assignment one is more dubious.
<jnthn> But silently failing is certainly wrong.
<masak> m​: my ($a, $b) = 1, 2; say $a
<camelia> rakudo-moar 02e1e9​: OUTPUT«1␤»
<masak> m​: my \a = 1; say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«1␤»
<masak> since those two work, I'd expect TimToady's first one to work.
<jnthn> masak​: That's not obvious.
<jnthn> masak​: \a variables are SSA and we don't create a container.
<TimToady> m​: my (\a) = 1; say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«(Any)␤»
<jnthn> I *thought* we had something in place that looked at
signatures and complained if they had anything that made them too
complex to drop to a simple list of containers.
<jnthn> m​: my ($a, *@​b) = 1, 2;
<camelia> rakudo-moar 02e1e9​: ( no output )
<jnthn> Hmm
<jnthn> I must be mis-rememebering or something.

Either the first eval should fail loudly, or it should work. We're not
quite sure. But it should not silently fail as it does currently.

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

From @AlexDaniel

This was fixed in (2015-12-15) rakudo/rakudo@d23a73d

All snippets from the log​:

my (\a,\b) = 1,2;      say a; say b   # OUTPUT​: «1␤2␤»
my (\a,\b) := \(1,2);  say a; say b   # OUTPUT​: «1␤2␤»
my (\a,\b) :​:= \(1,2); say a; say b   # OUTPUT​: «(exit code 1) ===SORRY!=== Error while compiling /tmp/li5UfU_taT␤"​::=" not yet implemented. Sorry.␤at /tmp/li5UfU_taT​:1␤------> my (\a,\b) :​:= \(1,2)⏏; say a; say b␤»
my ($a, $b) = 1, 2;    say $a; say $b # OUTPUT​: «1␤2␤»
my \a = 1;             say a          # OUTPUT​: «1␤»
my (\a) = 1;           say a          # OUTPUT​: «1␤»
my ($a, *@​b) = 1, 2;   say $a, @​b     # OUTPUT​: «1[2]␤»

:​:= is NYI and that's OK (but we probably want a tested fudge for it anyway).

「testneeded」

On 2015-03-30 08​:16​:46, masak wrote​:

<TimToady> m​: my (\a,\b) = 1,2; say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«(Any)␤»
<TimToady> seems like a bug
* masak submits rakudobug
<jnthn> That should either DWYM or whine, I guess.
<TimToady> m​: my (\a,\b) := \(1,2); say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«(Any)␤»
<TimToady> m​: my (\a,\b) :​:= \(1,2); say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«(Any)␤»
<jnthn> OK, *that* one certainly should work.
<jnthn> The assignment one is more dubious.
<jnthn> But silently failing is certainly wrong.
<masak> m​: my ($a, $b) = 1, 2; say $a
<camelia> rakudo-moar 02e1e9​: OUTPUT«1␤»
<masak> m​: my \a = 1; say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«1␤»
<masak> since those two work, I'd expect TimToady's first one to work.
<jnthn> masak​: That's not obvious.
<jnthn> masak​: \a variables are SSA and we don't create a container.
<TimToady> m​: my (\a) = 1; say a
<camelia> rakudo-moar 02e1e9​: OUTPUT«(Any)␤»
<jnthn> I *thought* we had something in place that looked at
signatures and complained if they had anything that made them too
complex to drop to a simple list of containers.
<jnthn> m​: my ($a, *@​b) = 1, 2;
<camelia> rakudo-moar 02e1e9​: ( no output )
<jnthn> Hmm
<jnthn> I must be mis-rememebering or something.

Either the first eval should fail loudly, or it should work. We're not
quite sure. But it should not silently fail as it does currently.

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Dec 12, 2017

From @zoffixznet

Tests​: Raku/roast@69d9d04601c8185b149d4fd7

@p6rt p6rt closed this as completed Dec 12, 2017
@p6rt
Copy link
Author

p6rt commented Dec 12, 2017

@zoffixznet - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant