mikehearn
01/22/2016, 3:01 PMevanchooly
01/22/2016, 3:12 PMTODO()
evanchooly
01/22/2016, 3:12 PMevanchooly
01/22/2016, 3:12 PMthrow new UnsupportedOperationException()
e.g.mikehearn
01/22/2016, 3:14 PMmikehearn
01/22/2016, 3:14 PMevanchooly
01/22/2016, 3:14 PMsvd
01/22/2016, 3:34 PMorangy
listOf<Nothing>()
can exist, but guarantees to have no elementsEugenio
01/22/2016, 3:42 PMevanchooly
01/22/2016, 3:44 PMudalov
return
, break
, continue
are expressions of type Nothing
😆udalov
val resource = loadResource() ?: return null
evanchooly
01/22/2016, 3:46 PMkirillrakhman
01/22/2016, 4:42 PMkirillrakhman
01/22/2016, 4:42 PMNothing
to a variable?kirillrakhman
01/22/2016, 4:43 PMval a = return
will compilemikehearn
01/22/2016, 4:43 PMkirillrakhman
01/22/2016, 4:44 PMmikehearn
01/22/2016, 4:44 PMmikehearn
01/22/2016, 4:45 PMkirillrakhman
01/22/2016, 4:45 PMferlisi
01/22/2016, 4:56 PMEugenio
01/22/2016, 5:45 PMvoddan
01/25/2016, 10:05 AM.lazy()
to be an alias to .asSequence()
It is much shorter (6 vs 12) and expresses the intent
The only problem I see is the collision with by lazy{}
, but at this point it is like a keyword reusemplatvoet
01/25/2016, 10:19 AMlazy
expresses the intent that well. Also, the number of chars doesn’t matter to me to since code completion only requires me to type just a few chars. I therefor think asSequence
expresses best that you want to have something rather "as a sequence". Code is mostly read, not written.voddan
01/25/2016, 1:04 PMasSequence()
appears far too often. Now I experienced this on myself, and confirm that asSequence()
hurts my eyes.voddan
01/25/2016, 1:07 PMlasy
is a well known word, and here it suits well. We could even go for a property .lazy
, but that would be slightly inconsistent, although not criticalmplatvoet
01/25/2016, 1:41 PMmplatvoet
01/25/2016, 1:41 PM