Introduce `lazyval`
- Linguagem predominante
- Java
- Estrelas
- 75
- Forks
- 16
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
# 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
```
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.