kotlin内联扩展函数run let apply also 及with函数的区别使用

1.将with run let的函数体的最后一行可以有返回值,with和run的调用者this可以隐式调用,调用者可空时with的this不可以隐式调用,let的调用者为it
kotlin内联扩展函数run let apply also 及with函数的区别使用
2.apply和also返回调用者本身,apply调用者为隐式this,also调用者为it
kotlin内联扩展函数run let apply also 及with函数的区别使用

总结:这个5个函数作用于语法糖简化代码,需要返回值的用with,run,let,不需要返回选其一使用,需要返回自身对象的使用apply,also。this或it作为调用者的代称基本无区别