vblang
vblang copied to clipboard
[Proposal] Set operations on collections using []
In additions to #556 , these is some more [] operations:
Dim x = {1, 2, 3}
Dim y = {2, 1, 0}
Dim z = x[] + y[] ' z = {3, 3, 3}
z = x[offset:= 1 default:= 0] + y[] ' z = {4, 4, 0}
z[count:= 5 default:= 1] = x[] * y[] ' z = {2, 2, 0, 1, 1}
Just by using Offset, count, default in [], we can control how the loop is done and how the results are stored.