dotnet / dotnet/vblang

[Idea] .Me to reference subject of With block

Open
#31 11 comments 1 reaction 0 assignees View on GitHub
Discussion LDM Review in progress
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

I find VB With blocks to be extremely useful. The idea here is to enhance the With block to be able to reference the subject of the block itself, not just a member of the subject.

For instance:

```
With New Grover
.Subparticle = Quark
.Limeade = "Quip"
NowDoSomething(.Me)
End With
```

This saves having to declare a variable as Grover and then using that variable. I don't want to declare a variable if I don't have to for something so short-lived.

If an object has a Me property (which I would think unlikely) it could be escaped as with other keywords (e.g., `x.[Me]`).

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.