[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-13 Thread Zoffix Znet via RT
On Fri, 12 Jan 2018 03:50:19 -0800, c...@zoffix.com wrote:
> This looks to be the same issue as RT#131099. It lists a potential fix
> that fails compilation:
> https://rt.perl.org/Ticket/Display.html?id=131099#txn-1455809

The fix is to throw on attempt to use list assoc on non-infixes, but
there're explosions with many other assocs; looks like anything that isn't 
unary. And
we can't throw on those, because assoc is meant to be used to disambiguate 
between
prefix/postfix that have same precedence.

It explodes in EXPR parser when trying to pop from @termstack. That area is too 
hard
for me right now, so I'm giving up on this ticket, in case anyone else wants to 
give a go...


[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-13 Thread Zoffix Znet via RT
On Fri, 12 Jan 2018 03:50:19 -0800, c...@zoffix.com wrote:
> This looks to be the same issue as RT#131099. It lists a potential fix
> that fails compilation:
> https://rt.perl.org/Ticket/Display.html?id=131099#txn-1455809

The fix is to throw on attempt to use list assoc on non-infixes, but
there're explosions with many other assocs; looks like anything that isn't 
unary. And
we can't throw on those, because assoc is meant to be used to disambiguate 
between
prefix/postfix that have same precedence.

It explodes in EXPR parser when trying to pop from @termstack. That area is too 
hard
for me right now, so I'm giving up on this ticket, in case anyone else wants to 
give a go...


[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-12 Thread Zoffix Znet via RT
On Thu, 11 Jan 2018 23:40:54 -0800, comdog wrote:
> I stupidly did this:
> 
> sub prefix:<²>  ( Int:D \m --> Int:D )
> is assoc
> { m ** m }
> 
> put ²(²2);
> 
> And got this error:
> 
> ===SORRY!===
> MVMArray: Can't pop from an empty array
> 
> I figure that associativity doesn't make any sense for unary prefix
> operators but that error message is from pretty deep in the swamp. I'd
> rather have something like "Don't do stupid things that make no sense"
> sort of error.


This looks to be the same issue as RT#131099. It lists a potential fix that 
fails compilation: https://rt.perl.org/Ticket/Display.html?id=131099#txn-1455809


[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-12 Thread Zoffix Znet via RT
On Thu, 11 Jan 2018 23:40:54 -0800, comdog wrote:
> I stupidly did this:
> 
> sub prefix:<²>  ( Int:D \m --> Int:D )
> is assoc
> { m ** m }
> 
> put ²(²2);
> 
> And got this error:
> 
> ===SORRY!===
> MVMArray: Can't pop from an empty array
> 
> I figure that associativity doesn't make any sense for unary prefix
> operators but that error message is from pretty deep in the swamp. I'd
> rather have something like "Don't do stupid things that make no sense"
> sort of error.


This looks to be the same issue as RT#131099. It lists a potential fix that 
fails compilation: https://rt.perl.org/Ticket/Display.html?id=131099#txn-1455809


[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-11 Thread brian d foy
# New Ticket Created by  "brian d foy" 
# Please include the string:  [perl #132711]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=132711 >


I stupidly did this:

sub prefix:<²>  ( Int:D \m --> Int:D )
is assoc
{ m ** m }

put ²(²2);

And got this error:

===SORRY!===
MVMArray: Can't pop from an empty array

I figure that associativity doesn't make any sense for unary prefix
operators but that error message is from pretty deep in the swamp. I'd
rather have something like "Don't do stupid things that make no sense"
sort of error.