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

list assignment to natively typed variables blows up #2541

Closed
p6rt opened this issue Oct 28, 2011 · 8 comments
Closed

list assignment to natively typed variables blows up #2541

p6rt opened this issue Oct 28, 2011 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Oct 28, 2011

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

Searchable as RT102416$

@p6rt
Copy link
Author

p6rt commented Oct 28, 2011

From @moritz

12​:09 < moritz> nom​: my int $x; my int $y; ($x, $y) = (5, 6); say $x
12​:09 <+p6eval> nom 642e78​: OUTPUT«Cannot assign to a non-container␤ in
method STORE at src/gen/CORE.setting​:3734␤ in block <anon> at
/tmp/15k6zUC4yA​:1␤ in <anon> at /tmp/15k6zUC4yA​:1␤»

Might be related to the same limitation that prevents us from having
sub f(int $x is rw) {...}

@p6rt
Copy link
Author

p6rt commented Oct 27, 2013

From @coke

On Fri Oct 28 03​:10​:51 2011, moritz wrote​:

12​:09 < moritz> nom​: my int $x; my int $y; ($x, $y) = (5, 6); say $x
12​:09 <+p6eval> nom 642e78​: OUTPUT«Cannot assign to a non-container␤ in
method STORE at src/gen/CORE.setting​:3734␤ in block <anon> at
/tmp/15k6zUC4yA​:1␤ in <anon> at /tmp/15k6zUC4yA​:1␤»

Might be related to the same limitation that prevents us from having
sub f(int $x is rw) {...}

Behavior has changed​:

18​:08 <[Coke]> r​: my int $x; my int $y; ($x, $y) = (5, 6); say $x
18​:08 <camelia> rakudo-jvm 882e33​: OUTPUT«(timeout)»
18​:08 <camelia> ..rakudo-parrot a33b16​: OUTPUT«Cannot modify an immutable
  value␤ in method STORE at gen/parrot/CORE.setting​:6744␤ in
  block at /tmp/JGkSPxFnHh​:1␤ in any at /tmp/JGkSPxFnHh​:1␤ in
  any at gen/parrot/stage2/NQPHLL.nqp​:1146␤ in any eval at
  gen/parrot/stage2/NQPHLL.nqp​:1133…»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 27, 2013

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

@p6rt
Copy link
Author

p6rt commented Oct 28, 2013

From @lizmat

On 27 Oct 2013, at 23​:10, Will Coleda via RT <perl6-bugs-followup@​perl.org> wrote​:

On Fri Oct 28 03​:10​:51 2011, moritz wrote​:

12​:09 < moritz> nom​: my int $x; my int $y; ($x, $y) = (5, 6); say $x
12​:09 <+p6eval> nom 642e78​: OUTPUT«Cannot assign to a non-container␤ in
method STORE at src/gen/CORE.setting​:3734␤ in block <anon> at
/tmp/15k6zUC4yA​:1␤ in <anon> at /tmp/15k6zUC4yA​:1␤»

Might be related to the same limitation that prevents us from having
sub f(int $x is rw) {...}

Behavior has changed​:

18​:08 <[Coke]> r​: my int $x; my int $y; ($x, $y) = (5, 6); say $x
18​:08 <camelia> rakudo-jvm 882e33​: OUTPUT«(timeout)»
18​:08 <camelia> ..rakudo-parrot a33b16​: OUTPUT«Cannot modify an immutable
value␤ in method STORE at gen/parrot/CORE.setting​:6744␤ in
block at /tmp/JGkSPxFnHh​:1␤ in any at /tmp/JGkSPxFnHh​:1␤ in
any at gen/parrot/stage2/NQPHLL.nqp​:1146␤ in any eval at
gen/parrot/stage2/NQPHLL.nqp​:1133…»

Actually, the simpler​:

  my int $x;
  ($x) = (5);

also fails. Added tests for that.

Liz

@p6rt
Copy link
Author

p6rt commented Mar 1, 2015

From @usev6

This works now​:

$ perl6 -e 'my int $x; my int $y; ($x, $y) = (5, 6); say $x'
5

One of the added test in S02-types/native.t was unfudge with commit Raku/roast@a86da6189b

It has to be resolved whether the following should return (Int) or (int) (cmp. http://irclog.perlgeek.de/perl6/2015-03-01#i_10201255)

$ perl6 -e 'my int $x; ($x) = (5); say $x.WHAT'
(Int)

1 similar comment
@p6rt
Copy link
Author

p6rt commented Mar 1, 2015

From @usev6

This works now​:

$ perl6 -e 'my int $x; my int $y; ($x, $y) = (5, 6); say $x'
5

One of the added test in S02-types/native.t was unfudge with commit Raku/roast@a86da6189b

It has to be resolved whether the following should return (Int) or (int) (cmp. http://irclog.perlgeek.de/perl6/2015-03-01#i_10201255)

$ perl6 -e 'my int $x; ($x) = (5); say $x.WHAT'
(Int)

@p6rt
Copy link
Author

p6rt commented Mar 28, 2015

From @jnthn

On Sun Mar 01 12​:47​:10 2015, bartolin@​gmx.de wrote​:

This works now​:

$ perl6 -e 'my int $x; my int $y; ($x, $y) = (5, 6); say $x'
5

One of the added test in S02-types/native.t was unfudge with commit
Raku/roast@a86da6189b

That's enough to resolve the ticket.

It has to be resolved whether the following should return (Int) or
(int) (cmp. http://irclog.perlgeek.de/perl6/2015-03-01#i_10201255)

$ perl6 -e 'my int $x; ($x) = (5); say $x.WHAT'
(Int)

That's unrelated to the ticket, and moreover a design issue. I'm inclined to think the current behavior is correct anyway; .WHAT operates at object level, and so boxing is natural.

Resolving, since the issue the ticket is about is fixed and tested.

Thanks,

Jonathan

@p6rt p6rt closed this as completed Mar 28, 2015
@p6rt
Copy link
Author

p6rt commented Mar 28, 2015

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

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

No branches or pull requests

1 participant