参考透明度
当术语“不可观察”与函数式编程中的术语“引用透明”一起使用时,其含义是什么?
What is the meaning of the term "Non-observable" when used in context with the term "referentially transparent" in functional programming?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能知道,术语“引用透明”意味着表达式的值只能取决于其各部分的值,而不取决于有关它们的任何其他事实。
例如,它不能依赖于以下内容:
所有关于程序当前状态的事实要么是真要么是假,但是没有任何表达式可以根据它们改变其值。所以这些东西被称为不可观察。
此网络漫画和其在 reddit 上的讨论也可能会给您带来启发。
As you might know, the term "referentially transparent" means that the value of expression can depend only on the values of its parts, and not on any other facts about them.
For example, it cannot depend on the following:
All those facts about the current state of the program are either true or false, but no expression can change its value depending on them. So those things are called non-observable.
This webcomic and its discussion on reddit might enlighten you as well.