A dumb implementation of a proto-lisp

Nathan McRae 4d20f6081a Flesh out the rest of evaluation 3 years ago
MyLisp 4d20f6081a Flesh out the rest of evaluation 3 years ago
MyLispConsole 4d20f6081a Flesh out the rest of evaluation 3 years ago
.gitignore 543b0084b7 Add gitignore 3 years ago
readme.md 16ee9c0764 Initial commit 3 years ago

readme.md

MyLisp

Cell := Data, Pointer

List of functions

Garbage collection

Environment is a sequences of Frames are a table of bindings which associate names with values (names must be single-valued)

var Value(Variable, Frame){
	if(Frame.Bindings.Contains(Variable)){
        return Frame.Bindings[Variable]
    } else if(Frame.Parent != null) {
        return Value(Variable, Frame.Parent)
    } else {
        throw new VariableNotBoundException()
    }
}

The way that Frames form sequences is by each having a pointer to another frame. Therefore we can have a tree of frames, with an environment for each leaf (corresponding to the sequence of frames from the leaf to the root).

Expression

Evaluation

var Eval(Expression, Environment){
    
}