Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ unop ::= !
function is_self_evaluating(stmt) {
return is_number(stmt) ||
is_string(stmt) ||
is_boolean(stmt);
is_boolean(stmt) ||
is_null(stmt);
}

// all other statements and expressions are
Expand Down Expand Up @@ -116,22 +117,6 @@ function analyze_name(stmt) {
};
}

/* Lists */
function is_list(stmt) {
return is_tagged_list(stmt, "array_expression");
}

function list_exp_list(stmt) {
return head(tail(stmt));
}

function analyze_list(stmt) {
const list_element_funcs = map(analyze, list_exp_list(stmt));
return (env, succeed, fail) => {

};
}

/* CONSTANT DECLARATIONS */

// constant declarations are tagged with "constant_declaration"
Expand Down Expand Up @@ -802,6 +787,10 @@ const the_empty_environment = null;
const primitive_functions = list(
list("display", display ),
list("error", error ),
list("list", list ),
list("pair", pair ),
list("head", head ),
list("tail", tail ),
list("+", (x,y) => x + y ),
list("-", (x,y) => x - y ),
list("*", (x,y) => x * y ),
Expand Down