Proposal: ValueTuple literals
- Dominant language
- No language data
- Stars
- 328
- Forks
- 71
- PR merge metrics
- No merged PRs in 30d
Description
### Motivation
Currently, we can't merge optional parameters with ValueTuple and specify their defaults at the same time. For example, if you want to implement your own `InputBox` and put `XPos` and `YPos` together, you can't set `Pos.X` to `-1` and `Pos.Y = -1` in the parameter list. You have to write `Pos As (X As Integer, Y As Integer)?`, and set default values when `Pos.HasValue` in the method body.
__The original InputBox__
```vb
Function InputBox(Prompt As String, Optional Title As String = "", Optional DefaultResponse As String = "", Optional XPos As Integer = -1, Optional YPos As Integer = -1) As String
```
__Grouped XPos and YPos with (X As Integer, Y As Integer)?__
```vb
Function InputBox(Prompt As String, Optional Title As String = "", Optional DefaultResponse As String = "", Optional Pos As (X As Integer, Y As Integer)? = Nothing) As String
```
### Solution
If we have ValueTuple literals, the code will be cleaner:
```vb
Function InputBox(Prompt As String, Optional Title As String = "", Optional DefaultResponse As String = "", Optional Pos As (X As Integer, Y As Integer) = (-1,-1)) As String
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.