Re: URI template: substring for dates

I agree that dates are much more common in URIs than times. Defining 3  
variables for each date field is not as bad as half-a-dozen, but it is  
still annoying: some specs will define pubYear, pubMonth, pubDay;  
others will define pub=yyyy-mm-dd. HTML5, for instance, might make it  
convenient to get a date into a single variable (eg <input  
type="date">), but a prefix/suffix template syntax will not be able to  
pick out the month.

I don't think you can say a prefix/suffix is qualitatively different  
than a substring in being ignorant of variable semantics. The prefix/ 
suffix syntax can indicate a beginning or ending point from either end  
of a value. The substring syntax just lets you indicate both. In all  
cases a value can be too small for the offsets so you get less than  
expected, or an empty string.

{var:end} and {var^begin} vs {var[begin,end]}

It is a minor difference; offering a little more functionality &  
flexibility; with a slightly more familiar syntax.

P.S. The syntax could be {var:begin,end} to support substring  
functionality while looking slightly less like a programming language.

P.S. Is there any reason to assume hash-based storage will only ever  
use 2 layers? Why not 3?
/{hash[,4]}/{hash[4,8]/{hash[8,]}

James Manger

Received on Monday, 2 November 2009 23:46:38 UTC