Introduce `lazyval`
- 主要言語
- Java
- スター
- 75
- フォーク
- 16
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
# WHY:
currently long boolean expressions cannot be organized and still benefit from lazy evaluation of boolean expressions
ex:
```
(heavyComputationFromASource1() && heavyComputationFromASource2()) || (heavyComputationFromBSource1() && heavyComputationFromBSource2()) || (heavyComputationFromCSource1() && heavyComputationFromCSource2())
```
is not equivalent to
```
val a = heavyComputationFromASource1() && heavyComputationFromASource2()
val b = heavyComputationFromBSource1() && heavyComputationFromBSource2()
val c = heavyComputationFromCSource1() && heavyComputationFromCSource2()
a || b || c
```
as at least `*Source1()` will be evaluated
# PROPOSAL:
With `lazyval` working under the hood as some kind of supplier code below would work and still benefit from lazy evaluation
```
lazyval a = heavyComputationFromASource1() && heavyComputationFromASource2()
lazyval b = heavyComputationFromBSource1() && heavyComputationFromBSource2()
lazyval c = heavyComputationFromCSource1() && heavyComputationFromCSource2()
a || b || c
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。