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
No documentation for overload::mycan #14082
Comments
From @karenetheridgeFrom a conversation between ribasushi and Father C. I just learned about the existence of overload::mycan. However, this is not documented at all. If it is a public interface, it should be documented in the overload pod. If it's not a public interface, it should start with a leading _ (underscore). |
From @cpansproutOn Wed Sep 10 10:24:18 2014, ether wrote:
It’s definitely not public. There are actually quite a few subroutines in overload.pm that are not documented. Some of them go all the way back to perl 5.002, which introduced overload (see 4633a7c). Let’s see: - OVERLOAD: Later, these were added: - nil A leading underscore is the usual convention, but not everything has to follow that. My usual rule is: If it’s not documented, don’t use it if you don’t want to risk having your code break. If we really wanted to make these things private, then why not use lexical subroutines since we have them (except for nil)? overload.pm is core-only, after all. But seeing that overload.pm has been very stable for years, I’m not sure it’s worth breaking code for cosmetic reasons. (I.e., these modules are taking the risk and we’ll break them if we have to, but only if we have to.) -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @karenetheridgeOn Wed Sep 10 10:53:04 2014, sprout wrote:
Role::Tiny now looks for _nil as well: ;) |
From @cpansproutOn Wed Sep 10 11:03:16 2014, ether wrote:
OK, so what is the underscore for, then? :-) Anyway, I just stopped at the first module I found for each function. These also use nil: MooseX::Role::WithOverloading -- Father Chrysostomos |
From @karenetheridgeOn Wed, Sep 10, 2014 at 11:18:12AM -0700, Father Chrysostomos via RT wrote:
A more public indication of: "we're using a private sub and we understand
I pushed updates for those as well.
The authors of these are active and responsible, and should be able to |
From @khwilliamsonOn 09/10/2014 12:48 PM, Karen Etheridge wrote:
Preceding the name of something with an underscore comes AFAIK from C++. |
From @ribasushiOn 09/10/2014 07:53 PM, Father Chrysostomos via RT wrote:
On a related note - shouldn't this method do exactly what I am trying to I tried to plug it into the SQLA test suite - it doesn't seem to behave |
From @ribasushiOn 09/10/2014 07:53 PM, Father Chrysostomos via RT wrote:
+1. Cleanup for the sake of cleanup is a nasty time waster, and is only |
From @cpansproutOn Wed Sep 10 22:44:06 2014, ribasushi@cpan.org wrote:
Looking at it more closely, I see it ignores the fallback setting. In fact, not only does it not serve its original purpose, but the value it now returns is not useful or informative in any way. Its original purpose was to be a quick check to see whether StrVal needed to bless the object temporarily into a non-overloaded class to stringify it, so false positives were fine. Now it’s heavyweight, not quick. Since it gives false positives, the method it returns is not useful. -- Father Chrysostomos |
From @ribasushiOn 09/11/2014 07:57 AM, Father Chrysostomos via RT wrote:
This was my reading of the source as well, I just wanted to make sure I A cursory search via http://grep.cpan.me/?q=OverloadedStringify reveals |
Migrated from rt.perl.org#122748 (status was 'open')
Searchable as RT122748$
The text was updated successfully, but these errors were encountered: