Re: URI Templates - optional variables?

On 15/10/2007, at 11:03 PM, Joe Gregorio wrote:

>
> On 10/15/07, Mark Nottingham <mnot@mnot.net> wrote:
>> That's what I've been saying all along -- obviously not very well :)
>>
>> IIRC, the issue that we never really resolved is invoking the
>> template rules; i.e. deciding when to look for and apply the special
>> syntax.
>>
>> We can come up with a library of rules for different scenarios (good
>> start in the other thread, btw), but we'll never be able to cover all
>> of the specialist cases. As such, there needs to be a way for a
>> template variable to specify additional processing, and for template
>> processing engines to be extended.
>
> Additional processing? No. But we can provide a mechanism by which
> new operators can be added. There's plenty of room for future  
> extensions,
> since every char outside unreserved and !?|'&<> can be used as a  
> new operator.

Right. So how do you manage that name space?

> An alternative to the current proposal is to replace the
> single character operators with names, that is:
>
>    {<arg|var}  ->   {?prefix?arg|var}
>    {>arg|var}  ->   {?append?arg|var}
>    {,arg|var}  ->    {?join?arg|var}
>    {&arg|var}  ->   {?joinlist?arg|var}
>
> etc.
>
> This makes new operators easier to add and we don't have to
> worry about running out of characters.
> Of course, that's a very english-centric solution, and
> the original proposal has the advantage of being uniformly
> cryptic to everyone.

I like the expanded space, not as worried about being english-centric  
(many protocols are, and it's not really end-user visible).


--
Mark Nottingham     http://www.mnot.net/

Received on Monday, 15 October 2007 23:38:14 UTC