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
Option to not BeginLift method declarations #8
Comments
What does "compatibility" with a competing module even mean? I'm confused. Also, having it happen at compile time seems like a feature, not a bug. I'm glad you're not removing it but I wonder why anyone would want to. |
There's a bunch of things going on. First, I agree. Compile time loading of subroutines is the correct thing. If nothing else, it makes them work just like Compatibility with MXMS is part of the plan to get MXMS out of MXD so MXD performs well. I also have an evil plan to write MouseX::Declare which would use MS. Florian was pretty adamant at the last QA Hackathon that I stop using Devel::BeginLift but never explained why. Still, he's the author and I'd like an escape plan if he decides to stop maintaining it. He also claimed that nobody wanted to use MS because of Devel::BeginLift... but never explained why. I know there's folks who think And if you want compile time methods, the option to turn it off has no effect. Finally, it's really trivial to add, it will shut people up and remove a piece of FUD. |
Bringing the relevant bits of the discussion over from #22:
Sure.
I don't think of it as shouting; it's a constant. All caps for constants is pretty standard. But I don't really care that much either way. :)
So basically something like:
? In this case, I don't think the BEGIN is shouting, but rather matches the Do we want any other ways to affect it? environment variables or anything? |
While it's technically a constant, more importantly it's an option or switch. For the same reason you don't write I do like I don't see this as the sort of thing you'd want to effect with environment variables. You don't want to affect code not written with this in mind, same as you wouldn't want to turn on strict in an environment variable. Alas, this reminds me that this behavior will have to be lexical. A simple internal switch won't cut it else multiple uses in one processes will stomp on each other. Crap. That's more than I can think about at the moment. |
Not sure how I can see to make it lexical, but I'll think on it. |
On 2011.9.15 12:47 AM, Buddy Burden wrote:
I started feature/compile_at_BEGIN to work on it. Normally we'd use %^H (see perlpragma) but that was introduced in 5.10. For Maybe we should just drop 5.8. |
Just riffing here .. What if we make our own pragma? It would be part of MS, so it's not like it would be out there in general. The pragma could use
or somesuch. I haven't completely thought this through, but it seems like it should be doable.
As a last resort, I'd consider it. But, I have to tell you: we're using 5.8 in production right now. In fact, the MXMS problems are what are keeping us from upgrading to 5.12. Now, obviously, all the work I've been doing on MS/MSM is to fix all that and enable us to upgrade to 5.12 eventually. But I have no idea if TPTB around here will want us to do those two things simultaneously, or upgrade to MSM first, then upgrade Perl versions, to reduce the number of variables changed at once, you know. So it's possible that dropping 5.8 altogether might really screw me. |
Okay, further thought without cold medicine kicking around my brain. :-) So obviously the problem here is how to make the Failing that, why not just use
That's not awful, is it? And it doesn't preclude adding a |
Oh, I hadn't realized Otherwise,
And you can't put the Let's hope |
D'oh! Yes, you're quite right.
Yeah, ditto that. I'll think some more on it, but I'm coming up blank on alternatives myself ATM. |
There is an additional complication (yay). Checking the value of The question is, how high does it look? We can hard code the current height, but that will change from version to version. We can look up the call stack until we see the existence of our hint, and that seems the most robust. Oh, the other problem is it appears |
A possibility is to use Devel::Pragma which seems to provide access to |
Okay, |
create a way to distinguish compile-time from run-time definition check pragma's default value, turning on and off, and lexical scope pragma's are commented out for now; just want to see if this satisfies testing for git issue #8
Ta da! Devel::Pragma solved all our problems... except one. It broke "into". The problem is "into" deliberately activates signatures from outside the scope it's acting on. For example...
Not sure what to do about that. Lexical scoping rules explicitly don't apply, it's acting on a namespace. |
Fixed it by making double sure compile_at_BEGIN defaults to on. The down side is you can't combine "into" and "compile_at_BEGIN" but I'm not worried about that right now. I'm pretty sick of the whole thing. All that's left is docs. |
Looks great! I don't mind doing the docs. I'll see if I can knock it out today. |
Oh, I did it before I read that. Go ahead and review/amend the docs. If you're happy with it, say "approved" and one of us will merge the branch. |
covers into + compile_at_BEGIN for #8
although now that I look at it, I think we might have a redundancy here might need to remove either this section or the one I added earlier
Okay, there's all I had that you didn't cover. (Plus I added a brief section to the MSM doco, but I apparently forgot to add the issue reference.) And I think one of my bits may overlap one of yours; sorry about that. I didn't really see it until afterwards. Let me know if you think this needs further tweaking. |
Nit: 5.8 isn't quite "early" as "earlier". For #8
Rather than have the user crawl through the notes. For #8
I merged the redundant docs and have merged the branch. Closing it up. |
Looks good. |
method
andfunc
both happen at compile time, just likesub
. This really annoys some people and it's incompatible with MooseX::Method::Signatures.Make an option so that you can turn this behavior off.
The text was updated successfully, but these errors were encountered: