3 ms·
I grabbed the code from the article and annotated it with the different cases from the famous picture* switch (expr.kind) { case "number"/"string"/"var":
by mrkeen 11mo ago
I grabbed the code from the article and annotated it with the different cases from the famous picture*
switch (expr.kind) {
case "number"/"string"/"var":
... [Var]
case "call":
... [App]
case "function":
throw new Error("...[Abs]")
case "let":
... [Let]
Looks like most of the hard work's done, and probably wouldn't be too tricky to get [Abs] in there too!
* https://wikimedia.org/api/rest_v1/media/math/render/svg/10d6e781d61259108db5fbfcfd84cb47daac33a6 https://wikimedia.org/api/rest_v1/media/math/render/svg/10d6...