Homework5 ä½ä¸åæ

1 / 15

# Homework5 ä½ä¸åæ - PowerPoint PPT Presentation

Homework5 作业分析. 张一鸣 5110379070. Homework5. 整体情况 错题分析 Challenge. Homework5. 整体情况 完成对一个自定义语言MUPL的简易编译器 24人上交了作业 4个人做了Challenge 18个人拿到了满分（不算Challenge）. Homework5. 错题分析 鉴于每题都有人错，所以就都稍微讲一下. Homework5. 1-a(wrong 1) racketlist-&gt;mupllist 2-a(wrong 2) mupllist-&gt;rackerlist. Homework5.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Homework5 ä½ä¸åæ' - xiu

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Homework5 作业分析

Homework5
• 整体情况
• 错题分析
• Challenge
Homework5
• 整体情况
• 完成对一个自定义语言MUPL的简易编译器
• 24人上交了作业
• 4个人做了Challenge
• 18个人拿到了满分（不算Challenge）
Homework5
• 错题分析
• 鉴于每题都有人错，所以就都稍微讲一下
Homework5
• 1-a(wrong 1)
• racketlist->mupllist
• 2-a(wrong 2)
• mupllist->rackerlist
Homework5
• 2 (wrong 2)
• 解析一个mupl的表达式
• 错在同一个地方
Homework5
• 3-a (wrong 2)
• 注意 0 要用 (int 0)
• 没用 ifgreater
• 正确
Homework5
• 3-b (wrong 4)
• 和let*一样的效果
• 正确答案
• 有2个同学在原本应该返 回e2 时返回了(e2)
Homework5
• 3-c (wrong 1)
• if e1 = e2 then e3 else e4
• 正确答案
• 唯一错误的同学是因为少了一个括号 →_→|||
Homework5
• 4-a (wrong 2) & 4-b(wrong 2)
• 写mupl的map函数
• 正确答案：
• 错误的同学错误原因类似，对于题目理解错误。
Homework5
• Challenge！
• 目标：主要区别在于closure，在解析fun的时候构建closure，challenge要求用只含有free variable的environment代替原来的environment.
• Free variable ：在函数体中除了函数自己、参数和函数体内声明（let, letrec .etc）的变量。
Homework5
• Challenge！
• compute-free-vars 把所有的fun替换为带有free variable的 fun-challenge.
Homework5
• Challenge！
• eval-under-env-c 按照eval-under-env的方式解析，主要有变化的是对fun-challenge的解析
• build-freevars-env