On 14.05.2013 00:18, Anthony Kilna wrote:
Apologies for not responding to your original inquiry Lukas, it slipped
through the cracks. I assure you I wasn't being hostile in missing the
one email you'd sent on the matter. :)
Ah, no problem. (And the "hostile" in the subject refers to my devious
attempts. :-)
Are you talking about using my namespace for a different purpose, or for
the same functionality?
If this is for different functionality, I don't think re-purposing
existing namespaces in CPAN is a good idea in principle, since any code
using the module would break in a spectacular and explodey ways when
upgraded. I wouldn't want that, even for this module; others might not
view my code as silly as I do.
If you are talking about implementing the same functionality using the
same conventions and provably better underpinnings, I like the idea.
However, I wouldn't want the module to suddenly be incompatible with
older perls only for the sake of using a new perl feature. Source
filtering gets a bad rap, but this module is so simple in its usage of
it that I can call the code relatively bulletproof. I'd like to see
what you have to replace it.
Well, it's sort of the same but not really. :-)
You can see the current state of development at
https://github.com/mauke/Quote-Reference .
According to metacpan there are no reverse dependencies, i.e. no other
module depends on Quote::Reference. But if you want to keep your
version, I'll find another name.
I had a look at your code and it's far from bulletproof IMHO:
- qwr/qwh aren't symmetric names. I would've expected qwa for arrays.
- Your code munging isn't anchored so it will destroy identifiers that
contain "qwr" or "qwh" anywhere.
- It doesn't allow spaces/comments between the keyword and the delimiter.
- The closing delimiter can't be escaped with a backslash. In fact, \
isn't treated specially. This can generate invalid code.
- For the paired delimiters ()[]{}<>, nesting isn't handled. This can
generate invalid code.
- If a paired opening delimiter lacks a closing delimiter, it is used
unpairedly, i.e. 'qwr<foo bar<' will turn into '[ qw<foo bar< ]' if no
'>' follows.
- It might be possible to trick it into recursively chain-expanding code
like 'qwr! qwr~foo~ !' - I haven't thought this through.
- This one would also need testing: As Filter::Simple replaces string
literals by placeholders during filtering, qwr'...' should turn into
qwr\034.... before being handed to your regex, which would interpret
\034 as the delimiter and break pretty much everything.
... and all of this on top of the general brokenness of source filters.
(Disclaimer: This is just from reading the code; I haven't actually
tried it.)
--
Lukas Mai <l....@web.de>