Skip Menu |

This queue is for tickets about the NEXT CPAN distribution.

Report information
The Basics
Id: 64384
Status: open
Priority: 0/
Queue: NEXT

People
Owner: Nobody in particular
Requestors: ambrus [...] math.bme.hu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: NEXT document interaction with mro
Date: Sat, 1 Jan 2011 22:39:24 +0100
To: bug-NEXT [...] rt.cpan.org
From: Zsbán Ambrus <ambrus [...] math.bme.hu>
Could you please have the pod documentation for the NEXT module to mention something about the interaction of mro (which changes the order methods are searched)? In particular, if I have a class with the declaration use mro "c3" so the method resolution order is changed, can I just use NEXT and expect it to continue searching subclasses in the same order as c3 does? You should also mention that mro exports the next::method and maybe::next::method methods, which are similar to NEXT::ACTUAL::DISTINCT::foo and NEXT::DISTINCT::foo respectively (where foo is the name of the current method; and I'm not sure about the DISTINCT part). Just in case it's needed, I'm looking at NEXT version 0.64, and mro version 1.02, both distributed with perl 5.12.2. Thanks, Ambrus
Subject: Re: [rt.cpan.org #64384] NEXT document interaction with mro
Date: Sun, 02 Jan 2011 18:07:00 +0100
To: bug-NEXT [...] rt.cpan.org
From: Florian Ragwitz <rafl [...] debian.org>
"ambrus@math.bme.hu via RT" <bug-NEXT@rt.cpan.org> writes: Show quoted text
> In particular, if I have a class with the declaration use mro "c3" so > the method resolution order is changed, can I just use NEXT and expect > it to continue searching subclasses in the same order as c3 does?
I dunno. What happens when you try it? I'd be quite happy to apply patches adding the documentation you think is missing. However, I don't think I'll be putting any real work, for documentation or otherwise, into NEXT any time soon. It's basically superseeded by mro/MRO::Compat. The only change I intend to do at some point is a formal deprecation. Show quoted text
> You should also mention that mro exports the next::method and > maybe::next::method methods, which are similar to > NEXT::ACTUAL::DISTINCT::foo and NEXT::DISTINCT::foo respectively > (where foo is the name of the current method; and I'm not sure about > the DISTINCT part).
I'm not sure about that one. They're different modules with different APIs. Each module documenting their own API would seem to be a reasonable thing. A mere reference to the other module's documentation appears to be enough for me, but I'm also open to patches in case you think otherwise. One other thing that might want to be mentioned as well is Class::C3::Adopt::NEXT, mapping the non-insane parts of the NEXT API to use mro/MRO::Compat, which is quite handy in the migration away from NEXT, allowing to use c3 dispatch without having to rewrite all code using NEXT right away. It also happens to document how to switch from NEXT to c3 and various caveats in doing so.
Download (untitled)
application/pgp-signature 197b

Message body not shown because it is not plain text.