什么是“按姓名致电"?

编程入门 行业动态 更新时间:2024-10-08 07:25:32
本文介绍了什么是“按姓名致电"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在做一项家庭作业,要求我们用我们开发的某种语言(使用Scheme)实施一种称为按名称致电"的评估策略.

I'm working on a homework assignment where we are asked to implement an evaluation strategy called "call by name" in a certain language that we developed (using Scheme).

我们在Scala中得到了一个示例,但我不知道该怎么做按名称呼叫"有效,与按需求呼叫"有何不同?

We were given an example in Scala, but I don't understand how "call by name" works and how it is different to "call by need"?

推荐答案

按需呼叫是按名称呼叫的记忆版本(请参见维基百科).

Call-by-need is a memoized version of call-by-name (see wikipedia).

在按名称调用中,每次使用该参数时都会对参数进行评估 ,而在按需调用方式中,参数将在首次使用时进行评估,并记录该值随后无需重新评估.

In call-by-name, the argument is evaluated every time it is used, whereas in call-by-need, it is evaluated the first time it is used, and the value recorded so that subsequently it need not be re-evaluated.

更多推荐

什么是“按姓名致电"?

本文发布于:2023-11-12 02:08:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580195.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:姓名   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!