- Scala Programming Projects
- Mikael Valot Nicolas Jorand
- 102字
- 2021-07-23 16:25:25
Ensuring referential transparency
We say that an expression is referentially transparent when it can be replaced by its value without changing the program's behavior, in any context. When an expression is a function call, it means that we can always substitute this function call with the return value of the function. A function that guarantees this in any context is called a pure function.
A pure function is like a mathematical function—the return value depends only on the arguments passed to the function. You do not have to consider anything else about the context in which it is called.
推薦閱讀
- TCP/IP入門經典(第5版)
- Drush User’s Guide
- Metasploit Penetration Testing Cookbook
- 中國互聯網發展報告2018
- Mastering Dart
- CCNP TSHOOT(642-832)認證考試指南
- Bonita Open Solution 5.x Essentials
- jQuery Mobile Web Development Essentials
- 5G技術與標準
- Learning Windows 8 Game Development
- 物聯網的機遇與利用
- LwIP應用開發實戰指南:基于STM32
- 趣話通信:6G的前世、今生和未來
- 5G新型多址技術
- SNS網站構建