From 8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Wed, 16 Apr 2014 23:57:50 -0500 Subject: All: move some fns to core. Major cleanup. - Don't import/require core until step4. - Define cond/or macros from step8 --- js/step3_env.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'js/step3_env.js') diff --git a/js/step3_env.js b/js/step3_env.js index 86981d2..7dbefc4 100644 --- a/js/step3_env.js +++ b/js/step3_env.js @@ -69,12 +69,11 @@ function PRINT(exp) { // repl var repl_env = new Env(); var rep = function(str) { return PRINT(EVAL(READ(str), repl_env)); }; -_ref = function (k,v) { repl_env.set(k, v); } -_ref('+', function(a,b){return a+b;}); -_ref('-', function(a,b){return a-b;}); -_ref('*', function(a,b){return a*b;}); -_ref('/', function(a,b){return a/b;}); +repl_env.set('+', function(a,b){return a+b;}); +repl_env.set('-', function(a,b){return a-b;}); +repl_env.set('*', function(a,b){return a*b;}); +repl_env.set('/', function(a,b){return a/b;}); if (typeof require === 'undefined') { // Asynchronous browser mode -- cgit v1.2.3