prg-titech / Kanon

A live programming environment specialized for data structure programming.
https://prg-titech.github.io/Kanon/
MIT License
68 stars 4 forks source link

undefined function parater #18

Closed masuhar closed 6 years ago

masuhar commented 6 years ago

The following code raises an "x is undefined" error at (seemingly) x.car in the else branch.

function append(x, y) {
    if (x===null) {
        return y;
    } else {
        return {car: x.car, cdr: append(x.cdr, y)};
    }
}

var l1 = { car: 123, cdr: null };
var l2 = { car: 456, cdr: null };
var l1 = append(l1,l2);

image