Skip to content

Conversation

khwilliamson
Copy link
Contributor

Now that I have documented INIT and kin in #23742, I realize that I and others have failed to realize its usefulness in removing most needs for using the

#ifdef DOINIT ... #else ... #endif

paradigm that requires repetitive lines, and makes things harder to read.

The only cases I found for needing the directives are when the initialization requires preprocessor directives itself. One such case is where it #includes a file.

This p.r. is a series of commits that convert DOINIT conditionals into INIT

  • This set of changes does not require a perldelta entry.

None of the affected code is in EBCDIC platforms; by making that the
outermost #ifdef, we can eliminate some nesting
Most of the tables defined here can use INIT() instead of the more
clumsy  #ifdef DOINIT..#else..#endif sequences.

The one that can't has #ifdef's in its initialization, so can't be
initialized with INIT().
By changing its regenerating program regcomp.pl
And avoid the more clumsy DOINITs
@khwilliamson khwilliamson added the Use merge commit Don't merge this p.r. from github It contains multiple related commits. Instructions in perlgit label Sep 28, 2025
There are no tables currently generated by this file that are affected,
however.
I'm uncertain about the other DOINIT use in this file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Use merge commit Don't merge this p.r. from github It contains multiple related commits. Instructions in perlgit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant