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

error with using meta assign ops with bound SetHash #6633

Closed
p6rt opened this issue Oct 23, 2017 · 5 comments
Closed

error with using meta assign ops with bound SetHash #6633

p6rt opened this issue Oct 23, 2017 · 5 comments

Comments

@p6rt
Copy link

@p6rt p6rt commented Oct 23, 2017

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

Searchable as RT132353$

@p6rt
Copy link
Author

@p6rt p6rt commented Oct 23, 2017

From @zoffixznet

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.

@p6rt
Copy link
Author

@p6rt p6rt commented Oct 30, 2017

From @lizmat

Fixed with b6a4d5b555520451c5c8a, this now DWIM, tests needed.

Error message being too long, fixed with 497e0582e6c64ccc04b2e9 .

On 23 Oct 2017, at 14​:28, Zoffix Znet (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Zoffix Znet
# Please include the string​: [perl #​132353]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/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;

@p6rt
Copy link
Author

@p6rt p6rt commented Oct 30, 2017

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

@p6rt
Copy link
Author

@p6rt p6rt commented Dec 11, 2017

From @zoffixznet

On Mon, 23 Oct 2017 05​:28​:04 -0700, cpan@​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 rakudo/rakudo#1203

@p6rt
Copy link
Author

@p6rt p6rt commented Dec 11, 2017

@zoffixznet - 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant