On 2005-12-10, David Emery <[EMAIL PROTECTED]> wrote:
>>
>> How about "?field" instead. So a full pattern would be
>>
>> articles/list/:year/?month/?day
>>
>> instead of
>>
>> articles/list/:year/:month?/:day?
>>
>> Just 2 characters shorter. I don't know if that would be confusing since
>> we're
>> used to seeing the '?' after the optional token in regexes.
I find this confusing because in Perl REs, the question mark comes
/after/ the thing that is optional. I think removing the colons remove
clarity too, because it's less clear whether wether "month" is a string
or variable.
> It looks to me kind of like you're just reinventing a dumbed down
> regex language. Why not just use normal Perl regexs? Besides not
> having to remember another syntax, you've got pretty well every
> conceivable case covered from the start. In most cases the regexes
> will be really simple, but if you want to do something bizarre, you're
> not limited to the scenarios envisioned by the developers, (making
> simple things easy, difficult things possible, or however that goes)
We started there. My first proposal looked like:
$self->dispatch([
qr{
/(?#rm) (\w+)
/(?#user) (\w+)
/(?#tags+) ([\w\+]+)
}x;
]);
Perl notably doesn't have named back references, which is what
I hacked around with (?#user). Full REs are uglier and seem
unnecessary, at least for an initial version.
>> So do we want this to be in CGI::Application::Dispatch?
Yes, if it can fit. I was intentional about not bringing it up in the
conversation, to avoid a sense we were constrained by its current
design.
>> Maybe there's someway to make it backwards compatible with what it
>> currently does, since it's pretty simple. Or we could break backwards
>> compatability and go for a 2.x generation and keep 1.x around... or
>> have a separate module all together. Although
>> "CGI::Application::Dispatch" is the perfect name for this new
>> functionality.
Would you be interested in working out how they might fit together?
It also might be fun to put the code in a public SCM system so others
can contribute easily. I prefer darcs, but using Jason Crome's SVN
server seems like an option that would go over well.
I should really give 'svk' another try now that some time has passed
anyway...
Mark
--
http://mark.stosberg.com/
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]