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
Pair.WHICH mishandles Scalar key #5583
Comments
From zefram@fysh.orgIf I construct a Pair whose key is a Scalar object, then the identity of
As you can see, the Pair.WHICH method is looking at the value inside the -zefram |
From zefram@fysh.orgAdditional: the Pair.key method also returns the content of a Scalar key,
-zefram |
From @geekosaurOn Tue, Aug 16, 2016 at 12:39 PM, Zefram <perl6-bugs-followup@perl.org>
Scalar objects are a leaked internal detail that aren't intended for direct -- |
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgBrandon Allbery via RT wrote:
I'm treating as first class those things that are presented as first FWIW, I think Scalar is a good reification, and the language would
As with [perl #128948], that's not really the Pair being mutable. I can -zefram |
From @geekosaurOn Tue, Aug 16, 2016 at 3:30 PM, Zefram <zefram@fysh.org> wrote:
It can't handle it. The implementation is precisely that needed for This is not to claim that the thing you are looking for is in any way -- |
From zefram@fysh.orgBrandon Allbery via RT wrote:
That's what I think it is. I'm mystified as to what you think I think -zefram |
From @geekosaurOn Tue, Aug 16, 2016 at 4:00 PM, Zefram <zefram@fysh.org> wrote:
Because of all the behaviors central to it being the implementation of a Let's try it this way: earlier I sai that yuou had created a mutable-key Arguably this situation should not be allowed to occur, but that's why .VAR -- |
From @lizmat
dd9b760 makes it impossible to create a Pair with a mutable key. Tests needed. |
From zefram@fysh.orgElizabeth Mattijsen via RT wrote:
Doesn't work. It defeats my original test case, but you're not actually
It would be better to reject the Scalar-as-key case entirely, rather -zefram |
From @geekosaurOn Tue, Aug 16, 2016 at 4:37 PM, Zefram <zefram@fysh.org> wrote:
Right, this kind of fix is a losing proposition. I'd prefer to see a proxy around the Scalar returned by .VAR that restricts -- |
From @lizmat
But then you still haven’t defeated it, as you can do nqp::create(Scalar). But then you also get into a territory where I wonder what sense it makes. I mean, in Perl 5 you can mark the canonical “undef” as “rw”, and then change it. With hilarious results. So I’m feeling we’re getting into DIHWIDT territory |
From @geekosaurOn Tue, Aug 16, 2016 at 4:45 PM, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
But you have to go into NQP to do that; you already took off all the -- |
From zefram@fysh.orgBrandon Allbery via RT wrote:
Yes, and to be clear I'm satisfied with that kind of distinction between -zefram |
From @geekosaurOn Tue, Aug 16, 2016 at 5:00 PM, Zefram <zefram@fysh.org> wrote:
I think .VAR can remain visible as long as the Scalar can't escape from it. -- |
From zefram@fysh.orgBrandon Allbery via RT wrote:
What would it yield if not the Scalar? That's the essence of .VAR
It's mentioned in the specs. S12 specifically advertises using it to -zefram |
From @lizmatReverted my Pair.new fix with b00d92d Suggest we mark this as stalled and/or @LARRY
|
From @lizmatSee discussion at http://irclog.perlgeek.de/perl6-dev/2016-08-16#i_13034703
|
From @geekosaurOn Tue, Aug 16, 2016 at 5:11 PM, Zefram <zefram@fysh.org> wrote:
If the proxy is itself an immutable type and makes itself visible instead That said, we've been tossing this around in IRC, and the Proxy type (which (ps lizmat: I'm geekosaur :) -- |
From zefram@fysh.orgBrandon Allbery via RT wrote:
That view doesn't work for the situation in [perl #128948]. It's quite intentional there that it's possible to create a Pair with But I was able to create two Pairs referencing the same Scalar value So it is untenable to hold that it is the Pair itself that is mutable.
The rebinding that occurs in Pair.freeze (which I discussed in [perl
I'm having difficulty discerning what distinction you're making here. -zefram |
From @geekosaurI'm trying to think how to put this better. In effect, Scalar isn't so much a mutable container object, as it is a bit A proper mutable container should have its own identity but expose the On Tue, Aug 16, 2016 at 6:07 PM, Zefram <zefram@fysh.org> wrote:
-- |
Migrated from rt.perl.org#128965 (status was 'open')
Searchable as RT128965$
The text was updated successfully, but these errors were encountered: