延迟加载和延迟评估有什么区别?
“延迟加载”和“延迟评估”(两者都是 Stack Overflow 上的标签)之间有区别吗?或者它们是同义词?
对评论的回应:标签维基(我在提出问题之前查看过)的前者指的是推迟初始化,另一个谈到推迟评估。是否可以在不评估某些东西的情况下对其进行初始化?
Is there a difference between "lazy loading" and "lazy evaluation" (both of which are tags on Stack Overflow), or are they synonymous?
Response to comment: The tag wikis (which I'd looked at before asking the question) has the former referring to deferring of initialization, and the other talked about deferring of evaluation. Is it possible to initialize something without evaluating it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
惰性求值是指表达式的求值方式。例如:
除非 f(x) 为 true,否则不会调用
g(x)
。延迟加载是指仅在需要时才初始化对象
lazy evaluation refers to how expressions are evaluated. For example:
g(x)
will not be called unless f(x) is true.Lazy loading refers to initializing objects only when they are needed