全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Pure function, side effect, referential transparency?

又称: side effect · pure function · referential transparency

Definition 9.9 University Computer Science — Year 2 · 第 9 章 — Functional Programming

A side effect is any effect of a call besides its result: a change to a variable outside it, an input or output, a panic. A function is pure if its result depends only on its arguments and it has no side effect. An expression is referentially transparent if replacing it by its value does not change the program.

在原文中阅读 →