-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 25 Apr 2007, at 21:18, Paul LeoNerd Evans wrote:
I'm still inviting comment on its behaviour though...
I like it. After
"This regexp should not contain any capture brackets ( ) as these
will confuse the parsing logic."
I'd add "Instead use
On Wed, 25 Apr 2007 13:44:11 -0500
"David Nicol" <[EMAIL PROTECTED]> wrote:
> has anyone mentioned "xeger" yet in this discussion?
Not heard of that, no..
And it's unfortunately a little late now, behold:
http://search.cpan.org/~pevans/String-MatchInterpolate-0.01/
An initial version :)
I'm
has anyone mentioned "xeger" yet in this discussion?
On Tue, 24 Apr 2007 14:20:40 -0400 (EDT)
"Daniel T. Staal" <[EMAIL PROTECTED]> wrote:
> How about Text::Transform::ReversiblePattern ?
>
> Or even just Text::ReversiblePattern ?
>
> Daniel T. Staal
I am tempted by that, but I would prefer it in the String:: space; as
A. Pagaltzis points out bel
On Tue, April 24, 2007 11:05 am, Paul LeoNerd Evans said:
> On Tue, Apr 24, 2007 at 04:01:10PM +0100, Andy Armstrong wrote:
>> Text::Transform::Reversible ?
>
> "Transform" is too generic.. text goes in, other text goes out... That
> doesn't capture the essence of pattern matching (no pun intended
* Paul LeoNerd Evans <[EMAIL PROTECTED]> [2007-04-24 19:40]:
> Also, String::Template sounds too much like Text::Template,
> which it isn't really.. It's a totally different idea.
Not to me. “Text” to means a document (or some arbitrarily small
unit of a document) that has meaning to a human. A “S
On Tue, Apr 24, 2007 at 07:30:56PM +0200, A. Pagaltzis wrote:
> I don’t know what it means for something to “sound like a
> namespace.” :-)
>
> Also, I think of templates as generally reversible anyway.
> Think of printf/scanf, strftime/strptime, URI::Template,
> etc. String templates often go bot
* Andy Armstrong <[EMAIL PROTECTED]> [2007-04-24 19:15]:
> String::Template::Reversible maybe? String::Template sounds
> like a namespace rather than a module.
I don’t know what it means for something to “sound like a
namespace.” :-)
Also, I think of templates as generally reversible anyway.
Thin
On 24 Apr 2007, at 18:07, A. Pagaltzis wrote:
So I think somewhere under either Text:: or String:: might be
better.
String::Template?
String::Template::Reversible maybe? String::Template sounds like a
namespace rather than a module.
--
Andy Armstrong, hexten.net
* Paul LeoNerd Evans <[EMAIL PROTECTED]> [2007-04-24 14:35]:
> It's not just parsing, it's not just interpolation. It's both.
> To name it after one of these operations ignores the other.
>
> So I think somewhere under either Text:: or String:: might be
> better.
String::Template?
Regards,
--
A
On Tue, Apr 24, 2007 at 04:01:10PM +0100, Andy Armstrong wrote:
> Text::Transform::Reversible ?
"Transform" is too generic.. text goes in, other text goes out... That
doesn't capture the essence of pattern matching (no pun intended :) ).
--
Paul "LeoNerd" Evans
[EMAIL PROTECTED]
ICQ# 4135350
On 24 Apr 2007, at 15:18, Sébastien Aperghis-Tramoni wrote:
If the main objects your module will manipulate still are URIs,
maybe it should be in the URI:: namespace. And couldn't the
bidirectional relation you want to create be seen like a mapping?
Hence URI::Mapper or something similar?
On Tue, Apr 24, 2007 at 04:18:11PM +0200, Sébastien Aperghis-Tramoni wrote:
> If the main objects your module will manipulate still are URIs, maybe
> it should be in the URI:: namespace. And couldn't the bidirectional
> relation you want to create be seen like a mapping? Hence URI::Mapper
>
Paul LeoNerd Evans wrote:
No, I think at this point we have to appeal to the core reason for
creating this module in the first place; namely, that it is
bidirectional. Parsing a string into variables, or interpolating the
variables back into a string. Both can be done within one object,
symmetri
On Tue, Apr 24, 2007 at 01:31:02PM +0100, Paul LeoNerd Evans wrote:
> String::ParsableInterpolable
>
> Surely we can do better than that?
Actually, I'm not even sure on the "parsable" part now. Parsing would
imply some sort of possibly-recursive, context-aware grammar system.
This is much simpl
On Fri, Apr 20, 2007 at 06:50:03PM +0100, Paul LeoNerd Evans wrote:
> package Parse::Reversable;
I'm suddenly not so sure on the name any more...
It's not just parsing, it's not just interpolation. It's both. To name
it after one of these operations ignores the other.
So I think somewhere under
* Paul LeoNerd Evans <[EMAIL PROTECTED]> [2007-04-21 15:00]:
> Theirs don't have the regexp matches like mine, but I guess
> that could always be done after the components have been pulled
> out. (Also the implementation is a bit less efficient, but that
> can be neatened up).
I think of URIs as s
On Fri, 20 Apr 2007 21:26:33 +0100
Andy Armstrong <[EMAIL PROTECTED]> wrote:
> I agree that it's not massively general - but you could use it to
>
> * generate fixed width fields
> * truncate reals to ints
> * specify the number of decimal places
On further thought, that all sounds very specific
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 21 Apr 2007, at 13:57, Paul LeoNerd Evans wrote:
Hmm.. Decisions... Do I change my code to use URI::Template, or
release
Parse::Reversible anyway, on the grounds that it does cover a slightly
different area, even if in my case they're both usabl
On Sat, 21 Apr 2007 01:09:51 +0200
"A. Pagaltzis" <[EMAIL PROTECTED]> wrote:
> * Paul LeoNerd Evans <[EMAIL PROTECTED]> [2007-04-20 19:55]:
> > The requirement for this module came about intially because I
> > was thinking about how to handle virtual URLs in websites
>
> It’s called “URI template
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 20 Apr 2007, at 22:44, Paul LeoNerd Evans wrote:
if only that, what happens if we want a literal : in our pattern -
do we
need to escape it?
Or maybe to make it look more like a pattern, we might try
${NAME/pattern/format}
Yup, or you coul
* Paul LeoNerd Evans <[EMAIL PROTECTED]> [2007-04-20 19:55]:
> The requirement for this module came about intially because I
> was thinking about how to handle virtual URLs in websites
It’s called “URI templates”, has an IETF draft RFC and there’s a
tentative implementation already on the CPAN.
R
On Fri, 20 Apr 2007 21:26:33 +0100
Andy Armstrong <[EMAIL PROTECTED]> wrote:
> > An interesting idea, but what does that buy you that a plain
> > sprintf does
> > not?
> >
> > $pr->build( { ALBUM => sprintf("%04d", $album),
> > PHOTO => sprintf("%04d", $photo) } )
>
> It encap
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 20 Apr 2007, at 20:23, Paul LeoNerd Evans wrote:
An interesting idea, but what does that buy you that a plain
sprintf does
not?
$pr->build( { ALBUM => sprintf("%04d", $album),
PHOTO => sprintf("%04d", $photo) } )
It encapsul
On Fri, 20 Apr 2007 18:55:56 +0100
Andy Armstrong <[EMAIL PROTECTED]> wrote:
> could optionally be
>
>'/photos/album${ALBUM:\d+:%04d}/photo${PHOTO:\d+:%04d}.jpg'
>
> to get back strings like
>
>'/photos/album0123/photo0001.jpg'
An interesting idea, but what does that buy you that a pla
On Fri, 20 Apr 2007 11:25:48 -0700
"Joshua ben Jore" <[EMAIL PROTECTED]> wrote:
> This is just named capturing, isn't it? In perl 5.10:
>
> qr!/photos/album(?\d+)/photo(?\d+).jpg!;
> $url = "/photos/album$+{ALBUM}/photo$+{PHOTO}.jpg";
Oh, it's that and more. It's a named capture, sure. But i
On 4/20/07, Paul LeoNerd Evans <[EMAIL PROTECTED]> wrote:
The requirement for this module came about intially because I was
thinking about how to handle virtual URLs in websites; for example:
/photos/album12/photo17.jpg
This will fetch the 17th photo from the 12th album, by whatever method
in
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 20 Apr 2007, at 18:50, Paul LeoNerd Evans wrote:
I'd appreciate some comments on this; specifically, if this
functionallity would be useful enough to put on CPAN, or if it seems a
quite specialised solution to a specific problem and not worth doin
The requirement for this module came about intially because I was
thinking about how to handle virtual URLs in websites; for example:
/photos/album12/photo17.jpg
This will fetch the 17th photo from the 12th album, by whatever method
internally is used. Internally, we need to know these values.
29 matches
Mail list logo