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

  • Functional Kotlin
  • Mario Arias Rivu Chakraborty
  • 112字
  • 2021-06-24 19:15:26

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.

主站蜘蛛池模板: 新泰市| 揭阳市| 海丰县| 灵台县| 蓝山县| 盱眙县| 嘉善县| 东方市| 古蔺县| 天门市| 新宁县| 利辛县| 剑阁县| 辽中县| 麻城市| 铜梁县| 乐亭县| 天津市| 长乐市| 长武县| 武功县| 兰坪| 渭南市| 洪湖市| 重庆市| 通化市| 潍坊市| 太谷县| 静安区| 阳山县| 普格县| 怀集县| 平山县| 澄迈县| 巫山县| 南和县| 铁岭县| 黄大仙区| 宝应县| 漠河县| 闵行区|