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

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.

主站蜘蛛池模板: 丹棱县| 和田市| 交城县| 台北市| 和田市| 修文县| 隆子县| 巩留县| 卢氏县| 柘荣县| 蕉岭县| 遂溪县| 宣恩县| 梨树县| 历史| 雅安市| 延津县| 唐海县| 陆良县| 贵州省| 东乌珠穆沁旗| 定南县| 拉孜县| 夹江县| 黑水县| 苏尼特左旗| 永平县| 黎城县| 宁阳县| 高州市| 弥勒县| 临沧市| 左贡县| 阿克陶县| 舒兰市| 高淳县| 兴化市| 云安县| 深州市| 睢宁县| 航空|