why $ is need to access array [negative index]?

Steven Schveighoffer schveiguy at gmail.com
Fri Sep 18 21:24:20 UTC 2020


On 9/18/20 5:14 PM, mw wrote:
> On Friday, 18 September 2020 at 21:11:58 UTC, Steven Schveighoffer wrote:
>> Well, if you don't care about verbosity.
>>
>> signs[(sign + $) % $] = ...;
> 
> I want compiler writes this verbosity, instead of the user :-)
> 

A custom type will do this for you. Just write one.

Would be as easy as:

arr.pyIdx[-1]; // uses python indexing.

-Steve


More information about the Digitalmars-d mailing list