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

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.

主站蜘蛛池模板: 龙胜| 宁夏| 桐梓县| 宣武区| 治县。| 张北县| 威信县| 贵德县| 德兴市| 玉田县| 永吉县| 青岛市| 玛多县| 台湾省| 富源县| 报价| 通河县| 宁海县| 瑞金市| 邢台市| 子洲县| 长沙县| 塔河县| 合作市| 项城市| 长治市| 无极县| 荔浦县| 华池县| 太康县| 景泰县| 黄冈市| 新疆| 岫岩| 乌拉特后旗| 甘洛县| 齐齐哈尔市| 通许县| 吉林省| 鹿邑县| 措勤县|