d-programming-language.org

David Nadlinger see at klickverbot.at
Sun Jul 3 12:58:24 PDT 2011


On 7/3/11 8:40 PM, eles wrote:
> -logic (not just code-writing or compile-writing easiness) consistency
> -the fact that multi-dimensional slicing (possibly, a future feature)
> is far more convenient when x..y is inclusive (just imagine
> remembering which those elements are left out on those many-
> dimensions of the data)
> -the fact that Ruby has implemented the inclusive syntax too (so
> there was some need to do that although the right-exclusive syntax
> was already available)
> -disjoint array slices would have disjoint index ranges (imagine
> cases where consecutive slices overlap a bit, like in moving average
> applications)

As discussed before, many people here, myself included, think that these 
arguments are purely subjective, and you don't make them any better by 
stating them over and over again.

Like I suggested in the previous thread, would you maybe consider just 
going ahead and writing some D code? While I imagine that you probably 
won't join the »open-right camp«, you might discover that the slicing 
syntax is not as big an issue as you are trying to make it appear.

Also, this is not a question of »now, flames are on (again)« – whether 
to use open-right or closed slicing is a design decision where the 
arguments for both alternative are roughly equivalent. D has gone with 
the former, and I don't quite see why you just can't accept this as a fact.

Besides, as Walter pointed out, there is no way the semantics of slicing 
could be changed at this point. The only thing that could be considered 
would be using something like a[0...1] for closed indexing.

David


More information about the Digitalmars-d mailing list