Lambda与环境模型 [英] Lambda and the Environment Model

查看:96
本文介绍了Lambda与环境模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在评估此代码时,我需要帮助绘制环境模型图的相关部分:

I need help drawing the relevant portions of the environment model diagram when evaluating this code:

Scheme>(define x 10)
Scheme> ((lambda (x y) (+ (y 3) x)) 6 (lambda (w) (* x 9)))

我需要确保将每个lambda正文写在要对其进行评估的环境旁边.

I need to make sure and write each lambda body next to the environment in which it is being evaluated.

好吧,我知道只有一个定义,因此大部分工作将由匿名"或无名"功能完成,并且这些功能仍将以各种方式显示在环境模型图中

Okay I know that there is only one define so most of the work will be done by "anonymous" or "nameless" functions and these will still show up in various ways in the environment model diagram

推荐答案

除了已经给出的答案之外,麻省理工学院的6.001课程还对环境模型,存在的原因以及其一些原因进行了两次非常全面的演讲.非常有用且细粒度的分步示例:

In addition to the answers already given, the 6.001 course at MIT has two very comprehensive lectures on the environment model, the reasons for its existence, as well as some very helpful and fine-grained step-by-step examples:

希望这会有所帮助,

Jason

这篇关于Lambda与环境模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆