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

»,« doesn't produce a structure of parcels #2147

Closed
p6rt opened this issue Sep 9, 2010 · 8 comments
Closed

»,« doesn't produce a structure of parcels #2147

p6rt opened this issue Sep 9, 2010 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Sep 9, 2010

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

Searchable as RT77746$

@p6rt
Copy link
Author

p6rt commented Sep 9, 2010

From @masak

<masak> rakudo​: my @​a=<a a a>;my @​b=<b b b>;for (@​a »,« @​b) »,« @​a ->
$a, $b, $c {say "$a $b $c"}
<p6eval> rakudo 859f2d​: OUTPUT«Sorry, sides are of uneven length and
not dwimmy. [...]
<masak> rakudo​: my @​a=<a a a>;my @​b=<b b b>;for (@​a >>,<< @​b) >>,<< @​a
-> $a, $b, $c {say "$a $b $c"}
<p6eval> rakudo 859f2d​: OUTPUT«Sorry, sides are of uneven length and
not dwimmy. [...]
<masak> <TimToady> that looks like a bug
* masak submits rakudobug
* moritz_ doesn't understand why
<moritz_> @​a »,« @​b return a list that's twice as long as @​a
<moritz_> so the error message is fine
<masak> there's no trickery with Parcels going on, then?
<moritz_> without the parens, one could argue about list associativity
<masak> if there's list associativity, the parens shouldn't matter...
<TimToady> there's no list context for @​a »,« @​b, so it should produce
a structure of parcels of the same length
<TimToady> hyperops aren't listy like zips

@p6rt
Copy link
Author

p6rt commented Oct 20, 2011

From @masak

On Thu Sep 09 00​:07​:14 2010, masak wrote​:

<masak> rakudo​: my @​a=<a a a>;my @​b=<b b b>;for (@​a �,� @​b) �,� @​a
->
$a, $b, $c {say "$a $b $c"}
<p6eval> rakudo 859f2d​: OUTPUT�Sorry, sides are of uneven length and
not dwimmy. [...]
<masak> rakudo​: my @​a=<a a a>;my @​b=<b b b>;for (@​a >>,<< @​b) >>,<< @​a
-> $a, $b, $c {say "$a $b $c"}
<p6eval> rakudo 859f2d​: OUTPUT�Sorry, sides are of uneven length and
not dwimmy. [...]
<masak> <TimToady> that looks like a bug
* masak submits rakudobug
* moritz_ doesn't understand why
<moritz_> @​a �,� @​b return a list that's twice as long as @​a
<moritz_> so the error message is fine
<masak> there's no trickery with Parcels going on, then?
<moritz_> without the parens, one could argue about list associativity
<masak> if there's list associativity, the parens shouldn't matter...
<TimToady> there's no list context for @​a �,� @​b, so it should
produce
a structure of parcels of the same length
<TimToady> hyperops aren't listy like zips

<phenny> masak​: 19​:36Z <[Coke]> tell masak I can't read
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=77746
* masak looks
<masak> that is an odd bug. how did it end up like that? :/
<masak> anyway, I think I can read it.
<masak> [Coke]​: �,� should be »,«
<[Coke]> masak​: can you mark that on the ticket? Thanks.
<masak> [Coke]​: will do.

@p6rt
Copy link
Author

p6rt commented Oct 20, 2011

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

@p6rt
Copy link
Author

p6rt commented May 26, 2013

From @coke

On Thu Oct 20 12​:48​:05 2011, masak wrote​:

On Thu Sep 09 00​:07​:14 2010, masak wrote​:

<masak> rakudo​: my @​a=<a a a>;my @​b=<b b b>;for (@​a �,� @​b) �,� @​a
->
$a, $b, $c {say "$a $b $c"}
<p6eval> rakudo 859f2d​: OUTPUT�Sorry, sides are of uneven length and
not dwimmy. [...]
<masak> rakudo​: my @​a=<a a a>;my @​b=<b b b>;for (@​a >>,<< @​b) >>,<< @​a
-> $a, $b, $c {say "$a $b $c"}
<p6eval> rakudo 859f2d​: OUTPUT�Sorry, sides are of uneven length and
not dwimmy. [...]
<masak> <TimToady> that looks like a bug
* masak submits rakudobug
* moritz_ doesn't understand why
<moritz_> @​a �,� @​b return a list that's twice as long as @​a
<moritz_> so the error message is fine
<masak> there's no trickery with Parcels going on, then?
<moritz_> without the parens, one could argue about list associativity
<masak> if there's list associativity, the parens shouldn't matter...
<TimToady> there's no list context for @​a �,� @​b, so it should
produce
a structure of parcels of the same length
<TimToady> hyperops aren't listy like zips

<phenny> masak​: 19​:36Z <[Coke]> tell masak I can't read
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=77746
* masak looks
<masak> that is an odd bug. how did it end up like that? :/
<masak> anyway, I think I can read it.
<masak> [Coke]​: �,� should be »,«
<[Coke]> masak​: can you mark that on the ticket? Thanks.
<masak> [Coke]​: will do.

Behavior changed​:

00​:47 <[Coke]> r​: rakudo​: my @​a=<a a a>;my @​b=<b b b>;for (@​a »,« @​b) »,« @​a ->
  $a, $b, $c {say "$a $b $c"}
00​:47 <camelia> rakudo 45ae2d​: OUTPUT«===SORRY!===â�¤Two terms in a rowâ�¤at
  /tmp/SrZN6trE4C​:1â�¤------> rakudoâ��​: my @​a=<a a a>;my @​b=<b b
  b>;for (@​a »,â�¤ expecting any of​:â�¤ argument listâ�¤
  postfixâ�¤ infix stopperâ�¤ infix or meta-infixâ�¤
  sâ�¦

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 26, 2013

From @masak

coke (>)​:

Behavior changed​:

[...]

Behavior did change, but that eval contained a thinko. The new behavior
is this​:

<masak> r​: my @​a=<a a a>;my @​b=<b b b>;for (@​a »,« @​b) »,« @​a -> $a, $b,
$c {say "$a $b $c"}
<camelia> rakudo 0e206e​: OUTPUT«Lists on both side of non-dwimmy hyperop
of infix​:<,> are not of the same lengthâ�¤left​: 6 elements, right​: 3
elements� in sub hyper [...]

Which, according to TimToady's original assessment -- previously in this
RT thread -- is wrong​:

<TimToady> there's no list context for @​a »,« @​b, so it should produce
a structure of parcels of the same length
<TimToady> hyperops aren't listy like zips

@p6rt
Copy link
Author

p6rt commented Aug 27, 2015

From @coke

On Sun May 26 00​:30​:48 2013, masak wrote​:

coke (>)​:

Behavior changed​:

[...]

Behavior did change, but that eval contained a thinko. The new behavior
is this​:

<masak> r​: my @​a=<a a a>;my @​b=<b b b>;for (@​a »,« @​b) »,« @​a -> $a, $b,
$c {say "$a $b $c"}
<camelia> rakudo 0e206e​: OUTPUT«Lists on both side of non-dwimmy hyperop
of infix​:<,> are not of the same lengthâ�¤left​: 6 elements, right​: 3
elements� in sub hyper [...]

Which, according to TimToady's original assessment -- previously in this
RT thread -- is wrong​:

<TimToady> there's no list context for @​a »,« @​b, so it should produce
a structure of parcels of the same length
<TimToady> hyperops aren't listy like zips

Behavior is changed again in the GLR branch​:

08​:58 < GLRelia> ..rakudo-moar 2ccea7​: OUTPUT«Lists on either side of non-dwimmy hyperop of infix​:<,> are not of the same
  lengthâ�¤left​: 2 elements, right​: 1 elementsâ�¤ in block <unit> at /tmp/tmpfile​:1â�¤â�¤Â»
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 14, 2015

From @niner

The current behavior is actually correct. HYPER is recursive. So it ends up calling HYPER(infix​:<,>, ("a", "b"), "a") which then fails.
Added a hint to that effect in Rakudo commit 99ee82c5af7179641b5f13543baac23b0baaf66c

@p6rt
Copy link
Author

p6rt commented Sep 14, 2015

@niner - 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