Re: Efficient HV fetches without recomputing the key hash

[email protected] ("Paul \"LeoNerd\" Evans") Tue, 9 Jun 2026 16:42:44 +0100
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
On Tue, 9 Jun 2026 12:08:42 +0100
Dave Mitchell <[email protected]> wrote:

> On Mon, Jun 08, 2026 at 09:05:46PM +0100, Paul "LeoNerd" Evans wrote:
> > Ah. So it turns out on some more thought, we actually already have
> > that with (v1) MAGIC. In particular, we have that with the standard
> > scalar magics  
> 
> I'm not entirely clear what exactly the "that"s above are referring
> to.

Oops, unclear wording on my part. I'll rewrite:

It turns out that on some more thought, we already have the situation
with (v1) MAGIC that there can be cases where MAGIC needs to provide
exactly one answer to a question. In particular, with scalar magics,
the `get` trigger needs to be handled across possibly-multiple
attachments, to ensure that we end up with the right answer.

At which point, we conclude that virtual arrays or hashes implemented
with magic that have to answer other questions like that (such as keys
or element lookups) aren't a new kind of situation, they're just more
of the same.

-- 
Paul "LeoNerd" Evans

[email protected]
http://www.leonerd.org.uk/  |  https://metacpan.org/author/PEVANS