-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix protex to enable it to work with Perl 5.30. #356
Conversation
I'm looking at this.... |
Thanks!
… On Feb 19, 2025, at 4:18 PM, Bill Sacks ***@***.***> wrote:
billsacks
left a comment
(esmf-org/esmf#356)
I'm looking at this....
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
<#356 (comment)> <https://github.com/notifications/unsubscribe-auth/AE6A7U3F3XLRCGKTJMAYBJL2QUGMXAVCNFSM6AAAAABXPCMJ46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZHE3TQOBYGM>
billsacks
left a comment
(esmf-org/esmf#356)
<#356 (comment)>
I'm looking at this....
—
Reply to this email directly, view it on GitHub <#356 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AE6A7U3F3XLRCGKTJMAYBJL2QUGMXAVCNFSM6AAAAABXPCMJ46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZHE3TQOBYGM>.
You are receiving this because you authored the thread.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, @oehmke ! I have forgotten most of the Perl I once knew, but I think I've gotten my head back into it enough to give this a decent (albeit not rock-solid, particularly given the obscurity of the $[
feature) review. I pushed a commit with some additional changes. It would be great if you gave this commit a quick look to make sure I didn't change anything that you deliberately were keeping as is or think shouldn't be changed:
See my inline comments below on two of these changes. Some of the changes are in comments, but I figured they should be changed, too, in case someone uncomments them. I also replaced uses of $[
with 0
, since now $[
will be 0 and that seems more clear and standard Perl. In addition, I found a few places that seemed like they should have been changed similarly to your other changes but weren't; I'd especially welcome your look at these to make sure they weren't things that you intentionally left as is.
I was least sure about the changes to the string-related things, but from a little test program, the changes to substr
seem correct; and it looks like the uses of index
here are okay; and based on a search for $[
in https://perldoc.perl.org/5.12.4/perlfunc, I don't see mention of this impacting any other functions.
@@ -92,7 +92,7 @@ | |||
|
|||
# Keep this if you don't know what it does... | |||
# ------------------------------------------- | |||
$[ = 1; # set array base to 1 | |||
# $[ = 1; # set array base to 1 (Removed to maintain compatability with Perl 5.30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it would be more clear just to remove this line, so I have done that.
if ($Fld[1] eq '!QUOTE:') { | ||
for ($i = 2; $i <= $#Fld; $i++) { | ||
if ($Fld[0] eq '!QUOTE:') { | ||
for ($i = 1; $i <= $#Fld - 1; $i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am removing the change you had here (subtracting 1 from $#Fld
): $#Fld
gives the index of the last element, and I think the correct thing to do is still to loop until i
is equal to the index of the last element. (I did a little test and $#Fld
changes with $[
, which I think makes it correct to not subtract 1 here.)
@billsacks |
@billsacks thanks for fixing those remaining issues! I took a look and I agree with your changes. I had a question about the $#Fld change, but that was before I saw your explanation below. I’ll merge this once I get clearance from the gold standard. :-)
… On Feb 19, 2025, at 4:54 PM, Bill Sacks ***@***.***> wrote:
@billsacks approved this pull request.
Thanks for doing this, @oehmke <https://github.com/oehmke> ! I have forgotten most of the Perl I once knew, but I think I've gotten my head back into it enough to give this a decent (albeit not rock-solid, particularly given the obscurity of the $[ feature) review. I pushed a commit with some additional changes. It would be great if you gave this commit a quick look to make sure I didn't change anything that you deliberately were keeping as is or think shouldn't be changed:
97b1aef <97b1aef>
See my inline comments below on two of these changes. Some of the changes are in comments, but I figured they should be changed, too, in case someone uncomments them. I also replaced uses of $[ with 0, since now $[ will be 0 and that seems more clear and standard Perl. In addition, I found a few places that seemed like they should have been changed similarly to your other changes but weren't; I'd especially welcome your look at these to make sure they weren't things that you intentionally left as is.
I was least sure about the changes to the string-related things, but from a little test program, the changes to substr seem correct; and it looks like the uses of index here are okay; and based on a search for $[ in https://perldoc.perl.org/5.12.4/perlfunc, I don't see mention of this impacting any other functions.
In scripts/doc_templates/templates/protex <#356 (comment)>:
> @@ -92,7 +92,7 @@
# Keep this if you don't know what it does...
# -------------------------------------------
- $[ = 1; # set array base to 1
+# $[ = 1; # set array base to 1 (Removed to maintain compatability with Perl 5.30)
I feel like it would be more clear just to remove this line, so I have done that.
In scripts/doc_templates/templates/protex <#356 (comment)>:
> @@ -296,8 +296,8 @@ LINE:
# Straight quote
# --------------
- if ($Fld[1] eq '!QUOTE:') {
- for ($i = 2; $i <= $#Fld; $i++) {
+ if ($Fld[0] eq '!QUOTE:') {
+ for ($i = 1; $i <= $#Fld - 1; $i++) {
I am removing the change you had here (subtracting 1 from $#Fld): $#Fld gives the index of the last element, and I think the correct thing to do is still to loop until i is equal to the index of the last element. (I did a little test and $#Fld changes with $[, which I think makes it correct to not subtract 1 here.)
—
Reply to this email directly, view it on GitHub <#356 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AE6A7U3B6UE5XBB6UBYDZET2QUKRTAVCNFSM6AAAAABXPCMJ46VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMRYGE3TGNBQGQ>.
You are receiving this because you were mentioned.
|
@danrosen25 are you ok with me merging this? It sounds like you are, but it doesn't look like you officially approved them, so I wanted to double check. |
I'm good with this change. |
Remove some outdated code that is no longer supported in recent versions of Perl.