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

hyperop of .= cannot be parsed #2789

Open
p6rt opened this issue Jun 14, 2012 · 4 comments
Open

hyperop of .= cannot be parsed #2789

p6rt opened this issue Jun 14, 2012 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 14, 2012

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

Searchable as RT113628$

@p6rt
Copy link
Author

p6rt commented Jun 14, 2012

From @masak

<sorear> p6​: @​*ARGS ».=« flip
<p6eval> ..rakudo 90333b​: OUTPUT«===SORRY!===␤ResizablePMCArray​: Can't
shift from an empty array!␤»
<sorear> hey, I broke Rakudo
* masak submits sorear's ResizablePMCArray rakudobug
<sorear> o/ masakbot
* masak bobs in mid-air
<masak> r​: (my @​) ».=« flip
<p6eval> rakudo 90333b​: OUTPUT«===SORRY!===␤ResizablePMCArray​: Can't
shift from an empty array!␤»
<masak> I'm tryin' to figger out what ».=« means, semantically.
<masak> so, infix​:<.=> is an operator that makes the rhs a bit special.
<masak> 'flip' is still a method.
<sorear> masak​: I vote for 'nothing'
<sorear> actually, I somewhat think .= should be treated syntactically
as an adverb
<sorear> accepted in infix position but otherwise parses as a postfix

@p6rt
Copy link
Author

p6rt commented Oct 14, 2012

From @coke

On Wed Jun 13 23​:13​:01 2012, masak wrote​:

<sorear> p6​: @​*ARGS ».=« flip
<p6eval> ..rakudo 90333b​: OUTPUT«===SORRY!===␤ResizablePMCArray​: Can't
shift from an empty array!␤»
<sorear> hey, I broke Rakudo
* masak submits sorear's ResizablePMCArray rakudobug
<sorear> o/ masakbot
* masak bobs in mid-air
<masak> r​: (my @​) ».=« flip
<p6eval> rakudo 90333b​: OUTPUT«===SORRY!===␤ResizablePMCArray​: Can't
shift from an empty array!␤»
<masak> I'm tryin' to figger out what ».=« means, semantically.
<masak> so, infix​:<.=> is an operator that makes the rhs a bit special.
<masak> 'flip' is still a method.
<sorear> masak​: I vote for 'nothing'
<sorear> actually, I somewhat think .= should be treated syntactically
as an adverb
<sorear> accepted in infix position but otherwise parses as a postfix

Error message has changed, and no longer exposing an internal parrot error.

23​:26 <[Coke]> r​: (my @​) ».=« flip
23​:26 <p6eval> rakudo 8230ae​: OUTPUT«===SORRY!===␤Error while compiling block :
  Error while compiling op call​: Error while compiling block :
  Error while compiling op call​: Error while compiling op
  callmethod​: Method call node requires at least one child␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 14, 2012

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

@p6rt
Copy link
Author

p6rt commented Sep 10, 2017

From @smls

On Wed, 13 Jun 2012 23​:13​:01 -0700, masak wrote​:

<masak> r​: (my @​) ».=« flip
<p6eval> rakudo 90333b​: OUTPUT«===SORRY!===␤ResizablePMCArray​: Can't
shift from an empty array!␤»

Still present in​:

  This is Rakudo version 2017.08-104-g76f1d8970
  built on MoarVM version 2017.08.1-148-g1059eed1
  implementing Perl 6.c.

It addition to an error, it now also prints a bogus "useless use" warning.

  ➜ my @​a = <ab xy>; @​a »~=» '1'; dd @​a;
  Array @​a = ["ab1", "xy1"]

  ➜ my @​a = <ab xy>; @​a ».=» flip; dd @​a;
  Potential difficulties​:
  Useless use of ».=« in sink context
  at -e​:1
  ------> my @​a = <ab xy>; @​a ⏏».=» flip; dd @​a
  ===SORRY!===
  Method call node requires at least one child

Here shown with the the right-facing hyper meta-op `» »`, which makes more sense here (though all forms currently fail in the same way).

Expected result for each form, IMO​:

  ».=»

  Array @​a = ["ba", "yx"]

  «.=»

  Array @​a = ["ba", "yx"]

  ».=«

  ERROR​:
  Lists on either side of non-dwimmy hyperop of .= are not of
  the same length
  left​: 2 elements, right​: 1 elements

  «.=«

  ERROR​:
  Lists on either side of non-dwimmy hyperop of .= are not of
  the expected length
  left​: 2 elements, right​: 1 elements

@p6rt p6rt added the parser label Jan 5, 2020
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

1 participant