-
Notifications
You must be signed in to change notification settings - Fork 578
An initial attempt at try/catch syntax #18505
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
Conversation
Some comments to reviewers:
|
4500339
to
89208a4
Compare
It looks reasonable to me, though I think the false exception object issue needs to be fixed before it is merged. |
PTAL. Many updates:
Will also edit the main PR description to match. |
PS I shall definitely squash most (or all?) of the commits together before it gets merged.. most of the commit messages shouldn't really stay in the merged copy. |
I wonder, should using try/catch (ideally) be changing
That said, I don't really expect this to work |
This was discussed in the p5p thread, I believe the answer was "ideally yes but it's way more difficult for the moment" |
Rather, in #18504 |
That's certainly a potential end goal, yes. As @Grinnz points out currently the related handling of |
a8569bf
to
98a092a
Compare
Squashed into fewer commits with better messages; rebased onto current blead. |
98a092a
to
830d235
Compare
Trying to find the right balance between forward velocity, and cautiousness on new features. This has been reviewed by a few people now. I have sent it to @iabyn to review but so far there's no word at all from him - not even to acknlowledge the request It'd be good to get it tried out in a few 5.33.x point releases ahead of 5.34 |
CxTRYBLOCK would be confusing when we add a real CxTRY for try/catch Also renames the associated CXp_TRYBLOCK flag to CXp_EVALBLOCK
830d235
to
52ee75a
Compare
* Add feature, experimental warning, keyword * Basic parsing * Basic implementation as optree fragment See also #18504
52ee75a
to
a1325b9
Compare
I don't think this should have been merged. The Perl Steering Committee is still discussing Perl 7 and waited for that discussion to be resolved before addressing new features like this one. |
I see. Hmm - well a little late for that now. I did announce my intentions loudly and clearly on each of of this issue in github, the perl5-porters@ mailing list, and the #p5p IRC channel on irc.perl.org. I gave well over a week of notice and got many OKs from folks all around, so I judged it to be fine. Was either the form or duration of my notice period somehow inadequate? |
I'd like to have an explanation of how this feature could possibly be more contentious or dangerous than anything previously scoped to Perl 7? (That is the only reason i could imagine for comparing this with Perl 7.) As an additional question, is that a comment intended to represent PSC or a private opinion? |
@xsawyerx this feature was planned before you announced your original perl7 plan and in fact had had significantly wider public discussion within the community before implementation was started than the perl7 plan did. This has broad community support and there's no reason to oppose its merging here - if anything you might consider the process that led to this merge to be a model of how do such things successfully by building broad consensus out in the open first. |
I don't think this feature is contentious or problematic. I don't think the manner in which it was discussed is a problem. I realize this was planned and worked on prior to the Perl 7 announcement. Thank you all for "informing" me of this, but none of these are my issues with it. The problem is a strategic one relating to a possible release of a Perl 7. If we release Perl 7, we leave Perl 5 with an experimental feature that will not have a stable release approving it. This might be okay and we're discussing it in the Council, but this merge forces us in this direction. |
There are several features currently experimental. If a plan for Perl 7 can't account for that then it will have to be improved. |
I suspect you were saying what you were saying made sense in the context of a PSC discussion that none of us are part of. I think you should expect to keep being misunderstood as long as the rest of us aren't provided the full context of what you're saying.
That could easily be fixed by a sunsetting release (python learned the hard way just how important those are), I don't see how this would be a hard problem to solve. |
Can you make a list of those?
I wouldn't necessarily go that far, but i agree that when making a claim without a fully grounded justification, some confusion is likely. And agreed as well, if experimentality of things is an issue, then it seems there should be a sunsetting release with no threads unresolved. |
They are listed in perlexperiment (of which I note, |
Good points. I guess I was hasty in my comment on this. I apologize. |
This PR adds try/catch notation, of the form specified by #18504; namely
When merged this is sufficient to pass the unit tests in the
Feature::Compat::Try
module at v0.02.In addition, at some point once this feature is merged it would be good to have a big trawl through much of the documentation (e.g. starting with
eval
inperlfunc
) to look for opportunities to draw attention to the new syntax, as well as fixing up examples currently written oneval
(several of which I expect will contain bugs because of it).