On Thursday, August 02, 2012 08:18:39 Jacob Carlborg wrote: > On 2012-08-01 22:20, Jonathan M Davis wrote: > > If you want really good performance out of a range-based solution > > operating on ranges of dchar, then you need to special case for the > > built-in string types all over the place, and if you have to wrap them in > > other range types (generally because of calling another range-based > > function), then there's a good chance that you will indeed get a > > performance hit. D's range-based approach is really nice from the > > perspective of usability, but you have to work at it a bit if you want it > > to be efficient when operating on strings. It _can_ be done though. > > Is it really worth it though? Most use cases will just be with regular > strings?
It's really not all that hard to special case for strings, especially when you're operating primarily on code units. And I think that the lexer should be flexible enough to be usable with ranges other than strings. We're trying to make most stuff in Phobos range-based, not string-based or array-based. - Jonathan M Davis