[perl #132353] [LTA] error with using meta assign ops with bound SetHash

2017-12-11 Thread Zoffix Znet via RT
On Mon, 23 Oct 2017 05:28:04 -0700, c...@zoffix.com wrote:
> This code produces an LTA error:
> 
> my %days := SetHash.new: Date.today … Date.new: '2030-04-02';
> %days ∖= %days.grep: *.key.day-of-week > 5;
> 
> First, the error reads "Cannot modify an immutable SetHash" which is
> confusing,
> since SetHash is a mutable type.
> 
> Second, the error dumps all of the contents of the SetHash, so for
> this code,
> the user has to scroll several pages up just to get to the error
> itself.


This no longer errors out.

Closing without tests, with the tests for new behaviour to be written when 
closing a related https://github.com/rakudo/rakudo/issues/1203


[perl #132353] [LTA] error with using meta assign ops with bound SetHash

2017-12-11 Thread Zoffix Znet via RT
On Mon, 23 Oct 2017 05:28:04 -0700, c...@zoffix.com wrote:
> This code produces an LTA error:
> 
> my %days := SetHash.new: Date.today … Date.new: '2030-04-02';
> %days ∖= %days.grep: *.key.day-of-week > 5;
> 
> First, the error reads "Cannot modify an immutable SetHash" which is
> confusing,
> since SetHash is a mutable type.
> 
> Second, the error dumps all of the contents of the SetHash, so for
> this code,
> the user has to scroll several pages up just to get to the error
> itself.


This no longer errors out.

Closing without tests, with the tests for new behaviour to be written when 
closing a related https://github.com/rakudo/rakudo/issues/1203


Re: [perl #132353] [LTA] error with using meta assign ops with bound SetHash

2017-10-30 Thread Elizabeth Mattijsen via RT
Fixed with b6a4d5b20451c5c8a, this now DWIM, tests needed.

Error message being too long, fixed with 497e0582e6c64ccc04b2e9 .

> On 23 Oct 2017, at 14:28, Zoffix Znet (via RT)  
> wrote:
> 
> # New Ticket Created by  Zoffix Znet 
> # Please include the string:  [perl #132353]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=132353 >
> 
> 
> This code produces an LTA error:
> 
>my %days := SetHash.new: Date.today … Date.new: '2030-04-02';
>%days ∖= %days.grep: *.key.day-of-week > 5;
> 
> First, the error reads "Cannot modify an immutable SetHash" which is 
> confusing,
> since SetHash is a mutable type.
> 
> Second, the error dumps all of the contents of the SetHash, so for this code,
> the user has to scroll several pages up just to get to the error itself.

FWIW, I think a more readable version of this is:

%days .= grep: *.key.day-of-week > 5;


Re: [perl #132353] [LTA] error with using meta assign ops with bound SetHash

2017-10-30 Thread Elizabeth Mattijsen
Fixed with b6a4d5b20451c5c8a, this now DWIM, tests needed.

Error message being too long, fixed with 497e0582e6c64ccc04b2e9 .

> On 23 Oct 2017, at 14:28, Zoffix Znet (via RT)  
> wrote:
> 
> # New Ticket Created by  Zoffix Znet 
> # Please include the string:  [perl #132353]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=132353 >
> 
> 
> This code produces an LTA error:
> 
>my %days := SetHash.new: Date.today … Date.new: '2030-04-02';
>%days ∖= %days.grep: *.key.day-of-week > 5;
> 
> First, the error reads "Cannot modify an immutable SetHash" which is 
> confusing,
> since SetHash is a mutable type.
> 
> Second, the error dumps all of the contents of the SetHash, so for this code,
> the user has to scroll several pages up just to get to the error itself.

FWIW, I think a more readable version of this is:

%days .= grep: *.key.day-of-week > 5;


[perl #132353] [LTA] error with using meta assign ops with bound SetHash

2017-10-23 Thread via RT
# New Ticket Created by  Zoffix Znet 
# Please include the string:  [perl #132353]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=132353 >


This code produces an LTA error:

my %days := SetHash.new: Date.today … Date.new: '2030-04-02';
%days ∖= %days.grep: *.key.day-of-week > 5;

First, the error reads "Cannot modify an immutable SetHash" which is confusing,
since SetHash is a mutable type.

Second, the error dumps all of the contents of the SetHash, so for this code,
the user has to scroll several pages up just to get to the error itself.