> On 16 Aug 2016, at 22:40, Brandon Allbery <allber...@gmail.com> wrote: > > On Tue, Aug 16, 2016 at 4:37 PM, Zefram <zef...@fysh.org> wrote: > Elizabeth Mattijsen via RT wrote: > >dd9b760 makes it impossible to create a Pair with a mutable key. > > Doesn't work. It defeats my original test case, but you're not actually > type-constraining the key, you're only removing a container wrapper. > > Right, this kind of fix is a losing proposition. > > I'd prefer to see a proxy around the Scalar returned by .VAR that restricts > what can be done with it, so it can't escape into the wild --- because once a > Scalar can be accessed directly, you've broken the type system.
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