[Submission] D Slices

Michel Fortin michel.fortin at michelf.com
Tue May 31 13:50:54 PDT 2011


On 2011-05-31 15:38:27 -0400, eles <eles at eles.com> said:

> But, it is just the very same operations that you would make for 0-
> based indexes, as well as for 1-based indexes. Is just like you would
> replace +j with -j (squares of -1). The whole mathematics would
> remain just as they are, because the two are completely inter-
> exchangeable. Because, in the first place, the choice of +j and of -j
> is *arbitrary*.
> 
> The same stands for 0-based vs. 1-based (ie. the field Zn could be
> from 0 to n-1 as well as from 1 to n). The choice is arbitrary.
> 
> But this choice *has nothing to do* with the rest of the mathematical
> theory, and nothing to do with the closed-limit vs. open-limit
> problem.

You're arguing about mathematics. Mathematically, there is little 
difference. I'll concede that.

It's about efficiency. It's about the compiler emitting less 
instructions, the processor making less calculations, and about your 
program running faster.

It also makes some things conceptually simpler, but that's hard to see 
until you're used to it. I think Nick Sabalausky made a good case for 
that.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list