How to cast Lambda to Unit

Well, less verbose doesn’t always mean more clean or readable.

I stopped using run and apply in my code because modifying the meaning of this turned out to be a bad idea in some cases, because it increases ambiguity.

Example: something.run { x=y } — when i write the code I knew that x is from something and y is from the parent object or the method’s scope… but after a while this code gets confusing and way less readable, resulting in bugs that are not easy to detect during a quick read.

I almost always use something?.let{something → } and if(…)… even if I write more code, it’s more readable.

I also use run, apply, but only when it’s highly needed