官术网_书友最值得收藏!

Pure functions

Pure functions don't have side effects, nor memory, nor I/O. Pure functions have many properties, including referential transparency, caching (memoization), and others (we'll cover these features in the next chapters).

It is possible to write pure functions in Kotlin, but the compiler doesn't enforce it as in other languages. It is up to you to create pure functions to enjoy its benefits. Because Kotlin doesn't enforce pure functions, many programmers said that Kotlin isn't a real functional programming tool, and maybe they are right. Yes, Kotlin doesn't enforce pure functional programming, and that gives you great flexibility including the ability to write in a purely functional style, if you wish.

主站蜘蛛池模板: 宜州市| 临颍县| 凭祥市| 宁都县| 乌恰县| 郸城县| 霍邱县| 肃北| 航空| 资溪县| 深圳市| 平谷区| 通许县| 肥乡县| 栾川县| 潢川县| 靖边县| 临夏县| 洪雅县| 阜康市| 中西区| 双桥区| 葫芦岛市| 东乡族自治县| 翁牛特旗| 福海县| 东丰县| 馆陶县| 赣州市| 鹿泉市| 长宁县| 宝应县| 渭源县| 宣恩县| 延吉市| 错那县| 象山县| 潮安县| 和顺县| 罗田县| 贵港市|