dotnet / dotnet/vblang

Last function call referrer

Open
#384 4 comments 1 reaction 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 to allow us to refer to the last returned result of the function, like this:
```
If Foo(x) <> y Then Return _Foo
```

VB compiler can compile it to:
```
Dim _Foo = Foo(x)
If _Foo <> y Then Return _Foo
```

Where <> y is just a placeholeder for any valid condition.

The _Foo will be generated only when it is used, so this will not affect functions performance (i.e. not all functiomns will have such back-field).

Note that _foo can be used more as needed in its scope:
```
If Foo(x) <> y Then Return _Foo
return _Foo - 1
```

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.