A possible solution for the opIndexXxxAssign morass

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Oct 14 07:21:25 PDT 2009


Lars T. Kyllingstad wrote:
> Kagamin wrote:
>> Robert Jacques Wrote:
>>
>>> Also needed is an extension of the opDollar to return different 
>>> values  based on the index:
>>> opDollar(size_t index);
>>
>> Dollar is just a synonym for length, isn't it?
> 
> 
> Yes, but if opIndex and opSlice take multiple indices (like in a matrix) 
> opDollar needs a way to distinguish between the different dimensions.
> 
> -Lars

I think the compiler should rewrite $ to __currentarray.length in unary 
index expressions, and to __currentarray.length!(n) in multiple index 
expressions.

Andrei



More information about the Digitalmars-d mailing list