91ParseXS: What Got Refactored
- May 11, 2010Rafael Garcia-Suarez requested a summary of the changes represented
by the previously posted diff. Here's a quick attempt at such a
summary. Please see my posts to the parsexs group on yahoo (late
March and April of this year) for more detailed discussion.
Moved main documentation to lib/ExtUtils/ParseXS.pod
Initialization of certain non-subroutine variables in
ExtUtils::ParseXS and some of its supporting packages was moved into
this package so that those values can be defined exactly once and
then re-used in any package (e.g., tests).
This package had been defined in the same file as ExtUtils::ParseXS.
Moved to separate file to make its contents more easily testable.
This is a grab-bag and its name should be treated as provisional.
Nonetheless, the contents are important. Essentially: Anything that
I could transform into a fully encapsulated subroutine was so
transformed and placed into this package. The subroutines thereby
became testable by new files in the test suite. Some of these
subroutines exist in CPAN lib/ExtUtils/ParseXS.pm; others are the
results of my refactoring.
Test suite: Renumbered existing tests to begin with 3 0-padded
digits. New test files I wrote start at t/101.
lib/ExtUtils/MM_Unix.pm: This should not be considered part of the
ParseXS distro per se, but it was needed to get the test harness to
Renaming and rescoping of variables:
Major effort went in to identifying the scope of all variables.
There were several instances of different variables having same name,
distinguished only by scope. Tried to rename appropariately. Most
globals were rescoped as 'our'. Some could be rescoped as 'my'.
Lots of code-tidying, e.g., elimination of hard tabs; uncuddling of
elsifs and elses; more consistent indentation; changed most
subroutine names to be all lower-case rather than CamelCase.