> -----Original Message-----
> From: SRU (Search and Retrieve Via URL) Implementors
[mailto:[log in to unmask]]
> On Behalf Of Ashley Sanders
>
> Funny that, I got the impression that most people preferred
> zero-based -- I certainly do. I also prefer start:length
> because as Mike Rylander points out, it is more "standard".
Just thought I'd throw in my two cents on the "standard"-ness of the
substring proposal. Java is zero-based and uses beginning and ending
offset. "dinosaur".substring(1:2) returns "i".
> Sorry, but no. What you're proposing does have negative numbers and a
> negative numbers is a special case. If it wasn't a special case you
> wouldn't have felt the need to add "If <length> is negative, ..."
Speaking of standardness, would someone care to point me at some
real-world examples of this? I've not run into negative offsets or
lengths in any of the languages I've learned.
> If you want a substring that works from the end of the string
> rather than the beginning have both "substring" and "r_substring".
> Then you'd have no need of negative numbers and special cases.
If you need this feature, this proposal would get my vote.
I'd like to ask a meta-question here. Is anyone going to implement this
stuff? I've been reluctant to chime in on some of these topics because
I have neither the ability nor intention of implementing many of the
things being discussed. I strongly think that we should NOT be adding
things to the standard that are not going to be broadly implemented. We
have a good extensibility mechanism and I'd suggest that funky features
should be profiled and implemented as extensions.
Ralph
|