Homework5
This presentation is the property of its rightful owner.
Sponsored Links
1 / 15

Homework5 作业分析 PowerPoint PPT Presentation


  • 111 Views
  • Uploaded on
  • Presentation posted in: General

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

Download Presentation

Homework5 作业分析

An Image/Link below is provided (as is) to download presentation

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 作业分析

张一鸣5110379070


Homework51

Homework5

  • 整体情况

  • 错题分析

  • Challenge


Homework52

Homework5

  • 整体情况

    • 完成对一个自定义语言MUPL的简易编译器

    • 24人上交了作业

    • 4个人做了Challenge

    • 18个人拿到了满分(不算Challenge)


Homework53

Homework5

  • 错题分析

    • 鉴于每题都有人错,所以就都稍微讲一下


Homework54

Homework5

  • 1-a(wrong 1)

    • racketlist->mupllist

  • 2-a(wrong 2)

    • mupllist->rackerlist


Homework55

Homework5

  • 2 (wrong 2)

    • 解析一个mupl的表达式

    • 错在同一个地方


Homework56

Homework5

  • 3-a (wrong 2)

    • 注意 0 要用 (int 0)

    • 没用 ifgreater

    • 正确


Homework57

Homework5

  • 3-b (wrong 4)

    • 和let*一样的效果

    • 正确答案

    • 有2个同学在原本应该返 回e2 时返回了(e2)


Homework58

Homework5

  • 3-c (wrong 1)

    • if e1 = e2 then e3 else e4

    • 正确答案

    • 唯一错误的同学是因为少了一个括号 →_→|||


Homework59

Homework5

  • 4-a (wrong 2) & 4-b(wrong 2)

    • 写mupl的map函数

    • 正确答案:

    • 错误的同学错误原因类似,对于题目理解错误。


Homework510

Homework5

  • Challenge!

    • 目标:主要区别在于closure,在解析fun的时候构建closure,challenge要求用只含有free variable的environment代替原来的environment.

    • Free variable :在函数体中除了函数自己、参数和函数体内声明(let, letrec .etc)的变量。


Homework511

Homework5

  • Challenge!

    • compute-free-vars 把所有的fun替换为带有free variable的 fun-challenge.


Homework512

Homework5


Homework513

Homework5

  • Challenge!

    • eval-under-env-c 按照eval-under-env的方式解析,主要有变化的是对fun-challenge的解析

    • build-freevars-env


Homework5

  • 谢谢!!


  • Login