dotnet / dotnet/vblang

Tuple-Like For Each Iteration

Open
#557 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

I suggest this syntax to allow foreach loops to operate on more than one collection:
```
For Each (aItem := 0, bItem := 0) in (A, B)
C.Add(aItem + bItem)
Next
```

Note that I am using the `:= ` syntax to set the default value to be used when the loop exceeds the length of one of the collections. If this part is omitted, VB will use the default value of the collection type.
The syntax is very close to tuples, so if should be familiar to us.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.