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

Either binding an array to a list containing the array itself should work consistently or not at all in Rakudo #2395

Open
p6rt opened this issue Mar 25, 2011 · 12 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 25, 2011

Migrated from rt.perl.org#87034 (status was 'open')

Searchable as RT87034$

@p6rt
Copy link
Author

p6rt commented Mar 25, 2011

From @masak

<masak> rakudo​: my @​foo := 1..3, @​foo; .say for @​foo[^10]
<p6eval> rakudo 792e86​: OUTPUT«1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤»
<masak> this is what I expect.
<pmurias> sorear​: explain what you mean by the second thing?
<masak> rakudo​: my @​foo := 1..3, (@​foo Z+ 100); .say for @​foo[^10]
<p6eval> rakudo 792e86​: OUTPUT«1␤2␤3␤101␤Any()␤Any()␤Any()␤Any()␤Any()␤Any()␤»
<masak> that... is not.
<masak> can we rely on array binding of the above kind to work?
<masak> if yes, is the second eval an expression of a rakudobug?
<masak> if no, how are we supposed to explain that some cases work and
some not? :/
<sorear> masak​: I beleive so on both counts
* masak submits rakudobug
<sorear> I expect "1 2 3 Any() Any() ..." for both of them

@p6rt
Copy link
Author

p6rt commented Mar 25, 2011

From @masak

On Fri Mar 25 14​:00​:30 2011, masak wrote​:

<masak> rakudo​: my @​foo := 1..3, @​foo; .say for @​foo[^10]
<p6eval> rakudo 792e86​: OUTPUT«1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤»
<masak> this is what I expect.
<pmurias> sorear​: explain what you mean by the second thing?
<masak> rakudo​: my @​foo := 1..3, (@​foo Z+ 100); .say for @​foo[^10]
<p6eval> rakudo 792e86​:
OUTPUT«1␤2␤3␤101␤Any()␤Any()␤Any()␤Any()␤Any()␤Any()␤»
<masak> that... is not.
<masak> can we rely on array binding of the above kind to work?
<masak> if yes, is the second eval an expression of a rakudobug?
<masak> if no, how are we supposed to explain that some cases work and
some not? :/
<sorear> masak​: I beleive so on both counts
* masak submits rakudobug
<sorear> I expect "1 2 3 Any() Any() ..." for both of them

<sorear> masak​: ignore everything I've said in the last 12 minutes; I misread
your example as my @​foo := 1..3; @​foo; .say for @​foo[^10]
<masak> ah :)
<sorear> and I was WTFing at the rakudoinsanity
* masak adds that to the rakudobug

@p6rt
Copy link
Author

p6rt commented Mar 25, 2011

@masak - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 25, 2011

From @masak

<sorear> eagerly (without {} blocks) self-referential binding will never work
<sorear> because all occurrences of @​fib in the RHS will be resolved to the old
container, which is discarded by the binding
<sorear> eagerly self-referential *assignment* may work in some cases
<masak> rakudo​: my @​selfref := 1, 2, 3, @​selfref; .say for @​selfref[^10]
<p6eval> rakudo 792e86​: OUTPUT«1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤»
<masak> sorear​: how come that works, then?
<sorear> masak​: rakudo's broken binding model
<masak> :(
<sorear> perl6​: my $x = 1; my $y := $x; $x := 3; say $y;
<p6eval> pugs, niecza v3-82-g1dc43eb​: OUTPUT«1␤»
<p6eval> ..rakudo 792e86​: OUTPUT«3␤»
<masak> that is indeed broken.
<masak> wow.

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @moritz

On Fri Mar 25 14​:48​:47 2011, masak wrote​:

<masak> sorear​: how come that works, then?
<sorear> masak​: rakudo's broken binding model
<masak> :(
<sorear> perl6​: my $x = 1; my $y := $x; $x := 3; say $y;
<p6eval> pugs, niecza v3-82-g1dc43eb​: OUTPUT«1␤»
<p6eval> ..rakudo 792e86​: OUTPUT«3␤»
<masak> that is indeed broken.
<masak> wow.

That one is fixed now, and tested in S03-binding/scalars.t.

Can anybody comment on our current understanding of the array binding cases?

@p6rt
Copy link
Author

p6rt commented Nov 10, 2015

From @usev6

Since Rakudo commit 3754356d8e this fails with X​::Syntax​::Variable​::Initializer​:

$ perl6-m -e 'my @​foo := 1..3, @​foo; .say for @​foo[^10]'
===SORRY!=== Error while compiling -e
Cannot use variable @​foo in declaration to initialize itself
at -e​:1
------> my @​foo := 1..3, @​⏏foo; .say for @​foo[^10]
  expecting any of​:
  term

In other words, binding an array to a list containing the array itself does not work at all. Therefore I'm closing this ticket as 'resolved'.

Test​: Raku/roast@dca1faef23

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 10, 2015

From @usev6

Since Rakudo commit 3754356d8e this fails with X​::Syntax​::Variable​::Initializer​:

$ perl6-m -e 'my @​foo := 1..3, @​foo; .say for @​foo[^10]'
===SORRY!=== Error while compiling -e
Cannot use variable @​foo in declaration to initialize itself
at -e​:1
------> my @​foo := 1..3, @​⏏foo; .say for @​foo[^10]
  expecting any of​:
  term

In other words, binding an array to a list containing the array itself does not work at all. Therefore I'm closing this ticket as 'resolved'.

Test​: Raku/roast@dca1faef23

@p6rt
Copy link
Author

p6rt commented Nov 10, 2015

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

@p6rt
Copy link
Author

p6rt commented Feb 17, 2017

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

@p6rt
Copy link
Author

p6rt commented Feb 17, 2017

From @AlexDaniel

Reopened for now.

See RT #​121807 and RT #​125371 for more info. Basically, there will be no error after I'm done with everything.

In case of binding, @​foo will appear as Mu. Binding doesn't make much sense in this case, DIHWIDT.

(Mu Z+ 5) will error out normally.

On 2015-11-10 13​:59​:32, bartolin@​gmx.de wrote​:

Since Rakudo commit 3754356d8e this fails with
X​::Syntax​::Variable​::Initializer​:

$ perl6-m -e 'my @​foo := 1..3, @​foo; .say for @​foo[^10]'
===SORRY!=== Error while compiling -e
Cannot use variable @​foo in declaration to initialize itself
at -e​:1
------> my @​foo := 1..3, @​⏏foo; .say for @​foo[^10]
expecting any of​:
term

In other words, binding an array to a list containing the array itself
does not work at all. Therefore I'm closing this ticket as 'resolved'.

Test​: Raku/roast@dca1faef23

@p6rt
Copy link
Author

p6rt commented Dec 14, 2017

From @AlexDaniel

By the way, there is a pull request​: rakudo/rakudo#1020

But the work on it is kinda stalled.

On 2017-02-17 04​:22​:51, alex.jakimenko@​gmail.com wrote​:

Reopened for now.

See RT #​121807 and RT #​125371 for more info. Basically, there will be
no error
after I'm done with everything.

In case of binding, @​foo will appear as Mu. Binding doesn't make much
sense in
this case, DIHWIDT.

(Mu Z+ 5) will error out normally.

On 2015-11-10 13​:59​:32, bartolin@​gmx.de wrote​:

Since Rakudo commit 3754356d8e this fails with
X​::Syntax​::Variable​::Initializer​:

$ perl6-m -e 'my @​foo := 1..3, @​foo; .say for @​foo[^10]'
===SORRY!=== Error while compiling -e
Cannot use variable @​foo in declaration to initialize itself
at -e​:1
------> my @​foo := 1..3, @​⏏foo; .say for @​foo[^10]
expecting any of​:
term

In other words, binding an array to a list containing the array
itself
does not work at all. Therefore I'm closing this ticket as
'resolved'.

Test​: Raku/roast@dca1faef23

@p6rt p6rt added the Bug label Jan 5, 2020
@lizmat
Copy link
Contributor

lizmat commented Jan 11, 2020

So what is the status now?

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

No branches or pull requests

2 participants