Discussion Thread: DIP 1037--Add Unary Operator ...--Community Review Round 1

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Oct 28 13:32:00 UTC 2020


On Tuesday, 27 October 2020 at 10:54:07 UTC, Mike Parker wrote:
> This is the discussion thread for the first round of Community 
> Review of DIP 1037, "Add Unary Operator ...":

I think it should be made more generic and flexible. Make it work 
with all sequence types that provides a length and indexing. Make 
it possible to offset. Make it work for empty sequences (initial 
value for fold/reduce). Make the comma-expansion more intuitive. 
E.g. (pseduo):

Given:

seq1 = /* 1 ,2, 3 */
seq2 = /* 10, 20, 30, 40, 50*/


IN:
(seq1[_]*10 + seq2[_+1], ...)

OUT (e.g. length = min(seq1.length, seq2.length):
(seq1[0]*10 + seq2[1], seq1[1]*10 + seq2[2], seq1[2]*10 + seq2[3])





More information about the Digitalmars-d mailing list