On Tue, 30 Jun 2015 21:02:37 +0000, DLearner wrote:

> Out of curiosity, why can't D define a 2-dim array by something like:
> int(2,1) foo;
> 
> which defines two elements referred to as:
> foo(0,0) and foo(1,0)?
Work is being done on multidimensional slicing, see this thread:
http://forum.dlang.org/post/dyvzmjfcjzoxvitwb...@forum.dlang.org
> 
> It just seems unnatural (if not actually dangerous) to me to have the
> array index order reverse between definition and use.

Think about it this way:

alias IntList = int[10];
IntList[3] myIntLists;
int[10][3] myOtherIntLists; // same type as above

You build the type up from the innermost layer to the outermost and when 
you access the data you reverse that operation, slicing deeper and deeper.

Reply via email to