kirillrakhman
09/28/2016, 4:37 PMkirillrakhman
09/28/2016, 4:37 PMcedric
09/28/2016, 4:37 PMcedric
09/28/2016, 4:37 PMcedric
09/28/2016, 4:37 PMbamboo
10/04/2016, 7:29 PMilya.gorbunov
10/04/2016, 9:23 PMlines()
or lineSequence()
) and join them back with system line separator (joinToString(System.getProperty("line.separator")!!)
).kevinmost
10/04/2016, 9:33 PMfun String.normalizeLineEndings() = lineSequence()
.filter { it.isNotBlank() }
.joinToString(separator = System.getProperty("line.separator")!!)
would be useful?kevinmost
10/04/2016, 9:34 PM.isNotEmpty()
is more appropriate actually. I think .isNotBlank()
would filter out lines that consist of just spaces, for examplebamboo
10/04/2016, 9:42 PMdebug
10/06/2016, 2:50 AMBoolean
like whenTrue
or whenFalse
? Haven't though deeply but I think this would be cool. Quite minor but when you figure out that your function returns that you have to start over with a if
.debug
10/06/2016, 2:51 AMisUserAMonkey().whenTrue { }.whenFalse { }
bamdmux
10/06/2016, 5:07 AMisUserAMonkey().apply{ if (true) this() else that()}
debug
10/06/2016, 5:28 AMthis
instead of true
there? yes that would work toobamdmux
10/06/2016, 5:39 AMdebug
10/06/2016, 5:59 AMbamdmux
10/06/2016, 6:49 AMmichaelrocks
10/06/2016, 8:47 AMif
😂
if (isUserAMonkey()) { } else { }
orangy
whenTrue {}.whenFalse {}
won’t really work well, since you will need return value from whenTrue
dimsuz
10/06/2016, 11:13 AMemptyList().all { predicate } => false
nonEmptyList().all { predicate } => true if all match
`stdlib`'s all returns true in the first case...dimsuz
10/06/2016, 11:15 AM!list.isEmpty() && list.all { predicate }
orangy
dimsuz
10/06/2016, 11:15 AMdimsuz
10/06/2016, 11:20 AM&&
solution works, but it chains badly.
I cannot do
list.filterNot { ... }
.isEmpty && all
dimsuz
10/06/2016, 11:20 AMkirillrakhman
10/06/2016, 11:21 AMkirillrakhman
10/06/2016, 11:21 AMall
test to fail if it's emptydimsuz
10/06/2016, 11:21 AMdimsuz
10/06/2016, 11:21 AMdimsuz
10/06/2016, 11:22 AM.notEmptyAndAllMatch { ... }
was my best try..