Differing semantics between multidimensional fixed-length array and slice initialization

Chris Cain clcain at uncg.edu
Wed Apr 3 11:33:47 PDT 2013


On Wednesday, 3 April 2013 at 15:44:52 UTC, ixid wrote:
>
> I wasn't arguing for the old style, the new declarations should 
> have read from left to right so [6][5][string]int and then you 
> access the elements in the same order that you assigned them, 
> that seems far less confusing and leaves less room for sleepy 
> mistakes. It seems like a pointless mental overhead so have to 
> keep swapping the order of your arguments.

Sorry for the misunderstanding, then. But to be fair, I'm sure 
that monarch_dodra meant that the new style is better than the 
old style, so my inference that you disagreeing with him saying 
the new style is better than the old style meant that you thought 
the old style was better isn't entirely unfounded.

I do have to agree that an even better syntax would have been to 
read types from left to right. However, that ship has sailed long 
ago (plus, I think the decision was made to make it more C-like 
in nature, which has its benefits as well).


More information about the Digitalmars-d-learn mailing list