tweak lambda evaluator
authorJim Pryor <profjim@jimpryor.net>
Thu, 23 Sep 2010 08:21:03 +0000 (04:21 -0400)
committerJim Pryor <profjim@jimpryor.net>
Thu, 23 Sep 2010 08:21:03 +0000 (04:21 -0400)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
code/parse.js
lambda_evaluator.mdwn

index fc3b83d..2718218 100644 (file)
@@ -79,7 +79,6 @@ var make_parse = function () {
             s = Object.create(original_symbol);
             s.id = s.value = id;
             symbol_table[id] = s;
             s = Object.create(original_symbol);
             s.id = s.value = id;
             symbol_table[id] = s;
-                       print(s, s.arity);
         }
         return s;
     };
         }
         return s;
     };
index 99aff25..c0e19a5 100644 (file)
@@ -82,11 +82,11 @@ Object.prototype.error = function (message, t) {
         try {
             tree = parse(source);
  //           string = JSON.stringify(tree, ['key', 'name', 'message', 'value', 'arity', 'first', 'second', 'third', 'fourth'], 4);
         try {
             tree = parse(source);
  //           string = JSON.stringify(tree, ['key', 'name', 'message', 'value', 'arity', 'first', 'second', 'third', 'fourth'], 4);
//           string = JSON.stringify(tree.handler(), ['key', 'name', 'message', 'value', 'arity', 'first', 'second', 'tag', 'variable', 'left', 'right', 'bound', 'body' ], 4);
+            string = JSON.stringify(tree.handler(), ['key', 'name', 'message', 'value', 'arity', 'first', 'second', 'tag', 'variable', 'left', 'right', 'bound', 'body' ], 4);
                        expr = tree.handler();
                        // string = expr.to_string() + "\n\n~~>\n\n";
                        expr = tree.handler();
                        // string = expr.to_string() + "\n\n~~>\n\n";
-                       string = '';
-                       string = string + reduce(expr, false, false).to_string();
+                       // string = '';
+                       // string = string + reduce(expr, false, false).to_string();
         } catch (e) {
             string = JSON.stringify(e, ['name', 'message', 'from', 'to', 'key',
                     'value', 'arity', 'first', 'second', 'third', 'fourth'], 4);
         } catch (e) {
             string = JSON.stringify(e, ['name', 'message', 'from', 'to', 'key',
                     'value', 'arity', 'first', 'second', 'third', 'fourth'], 4);