At 6:38 PM +0100 3/3/07, Paul Cochrane wrote:
Great to have someone else help to muck out the cage!

One solution would be to create a hash with the absolute paths of
exempt Perl files as keys at module compile time, or at singleton
object creation time.  The "is_perl_exemption" method would then
simply become a hash key lookup.
Absolute paths is probably the right way to go, so that the tests find
the relevant files and the module as well.  I've been meaning to sit
down and work out the problems in P::D for a while, but $work has been
*really* busy recently.  James Keenan is also probably quite happy
that someone else is having a look into this :-)

Well, being at the European Perl Hackathon sort of gave me the tuits to finally *do* something, instead of just lurking. I hope to be able to find some more tuits when $work kicks in again...


Another way would be to *not* use any globbing in determining the
list of exempt Perl files, but instead list all of the appropriate
files somewhere (similar to "is_c_exemption"), making
"get_perl_exemption_regexp" obsolete.
The get_perl_exemption_regexep() method is flawed, and shows my level
of misunderstanding of what things were doing.  Feel free to rip it
out if you wish.  I'd recommend against listing all the Perl files
explicitly as that would make the maintenance job harder.  It is far
nicer to be able to go "all files under lib/Pod should be exempt"
rather than having to specify all of the files.  So I guess I'm
leaning more towards keeping globbing.

On the other hand, I think that both the "is_c_exemption" and
"is_perl_exemption" lookups are flawed as currently implemented, as
they only look at the last part of the complete filepaths.  This is
most probably correct, but may produce false positives or negatives
(which is what the problem is now) when the current directory is
changed.  Creating and storing absolute filenames at compile time of
the Parrot::Distribution module makes more sense to me, and would
allow for significantly more efficient tests.
Something went wrong with the is_*_exemption() methods after
refactoring, and they don't seem to pick up what I intended when I
first wrote them.  What I intended was "all files under this dir
including subdirs" however, at present one only gets "all files under
this dir *excluding* subdirs".  Hence one reason why the methods
aren't exempting the right files.

*Any* ideas you have wrt improving the methods and/or functionality
thereof is greatly appreciated!

You might also like to talk to James Keenan about this as he has been
working on P::D a bit himself, and wanted to make these changes in a
branch rather than on the trunk.  Jerry also wanted to move a bit more
to a branch development model, so it might be a good idea to make any
of your changes within the relevant branch (sorry don't know what that
is specifically at present).

Hope some of this has helped!

It definitely did!


Liz

Reply via email to