develooper Front page | perl.perl5.porters | Postings from November 2017

Re: [perl #119803] $ISA[0] assignment does not work

Thread Next
From:
Zefram
Date:
November 19, 2017 15:39
Subject:
Re: [perl #119803] $ISA[0] assignment does not work
Message ID:
20171119153912.GO4913@fysh.org
Father Chrysostomos wrote:
>But internal bookkeeping that happens at the time of @ISA adjustment
>should probably simply be deferred if the hierarchy is nonsensical.

More simply, we could just make the linear_isa caching lazy in all
cases.  That's an appealing idea.  However, there are API implications.
The functions mro::get_isarev() and mro::is_universal() are defined to
indicate a given class's descendants.  This knowledge arises from the
process of generating the linear_isa for each descendant.  Internally
we use the isarev for cache invalidation, and for that purpose it
doesn't have to be a complete list of descendants: it only has to
list those descendants whose cached linear_isa includes this class.
But the documentation of the public interfaces describes them as giving
information about the actual set of descendants, with no caveats about
reflecting only cached information.

So to make the caching lazy we'd have to either withdraw mro::get_isarev()
and mro::is_universal() or redocument them as having much more limited
utility.  A deprecation cycle might be required.  What we should do
here depends somewhat on how these functions are used in practice.
Can someone comment on that?

-zefram

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About