Matrix-type-friendly syntax and more

Norbert Nemec Norbert at Nemec-online.de
Mon Oct 10 11:03:02 PDT 2011


On 10.10.2011 07:34, Don wrote:
> On 10.10.2011 04:41, kenji hara wrote:
>> 2011/10/10 bearophile<bearophileHUGS at lycos.com>:
>>> So is this:
>>> y[$-6, 0..$:2]
>>>
>>> Translated like this?
>>> y.opIndex(y.opDollar!0 - 6, y.opSlice!1(0, y.opDollar!1, 2))
>>
>> I have no thought about it.
>> I'm not sure that the additional stepping is really useful, but I
>> think adding it into syntax is not impossible -- it might not conflict
>> with associative array literal.
>>
>> Kenji Hara
> 
> Personally, I think that since strided operations are so inefficient,
> they should remain ugly.

Inefficient?! For multidimensional arrays, all but one dimension have
non-trivial, runtime-dependent strides anyway.

Anyway, the expressiveness gained by strides is significant and the
effort to allow it in the language is minimal.


More information about the Digitalmars-d mailing list