Translating SimpleJS into LambdaJS
- Implement the following translation function from SimpleJS into LambdaJS.
def
J[[x.y]] ==(deref x)[y]
def
J[[x.y := e]] ==let data = [[e]] in
let o = (deref x) in
x := o[y] data; data
J[[x.y(e)]]] ==def let m = (deref x)[y] in
let f = (deref m)[$code] in f(x,[[e]])
J[[function(x) {e}]] ==def alloc {$code : (this,x).[[e]],prototype : alloc {}}
def
J[[new ef(e)]] ==let ctor = deref [[ef]] in
let obj = alloc {$proto : ctor[prototype]} in
let f = ctor[$code] in f(obj,J[[e]]); obj
def
J[[c]] ==c
def
J[[x]] ==x
def
J[[let x = e1 in e2]] ==let x = [[e1]] in [[e2]]

![[Solved] CS450 Homework8-Translating SimpleJS into LambdaJS](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] CS450 Assignment7-Modifying The Metacircular Evaluator](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.