Jay
01/29/2019, 1:53 PMreturn <whatever>
from lambdas - I know I just need to remove the return
, but can anyone explain the error message to me? From the expected type it looks as if the return
from within the lambda is capable of terminating the enclosing function call - how is this possible? Would this pop the stack from the lambda, the partition
call, and the enclosing function - like a throw
?spand
01/29/2019, 1:56 PMJay
01/29/2019, 2:28 PMShawn
01/29/2019, 2:29 PMJay
01/29/2019, 2:30 PMfilter
too then (I missed that one)Shawn
01/29/2019, 2:31 PMcrossinline
, which disallows non-local returns, but isn’t quite the silver bullet you’re looking forJay
01/29/2019, 2:37 PMpartition
. However I initially didn’t see this and implemented it using what I’d learned so far. However looking at the code again, will the partition
in my example create two collections vs the commented out implementation which doesn’t create any collections and just iterates the existing one once (in the count{}
)?Shawn
01/29/2019, 2:39 PM.count()
thoughJay
01/29/2019, 2:40 PMcount()
- no predicate, so it just returns size
Shawn
01/29/2019, 2:42 PMJay
01/29/2019, 2:43 PMpartition
takes me to the implementation which creates two array lists.partition
.Shawn
01/29/2019, 2:44 PM