From 291f9771f51e73a17b576eae666c6ecabbc13ddf Mon Sep 17 00:00:00 2001 From: Ken Elf Mathieu Sternberg Date: Wed, 1 Jul 2015 13:24:45 -0700 Subject: [PATCH] Found the disconnect. As always, a type issue. Dammit. --- chap3.rkt | 10 ++++++++++ chapter3/interpreter.coffee | 2 +- chapter3/test.coffee | 6 ++++++ test-reports.xml | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 chap3.rkt create mode 100644 chapter3/test.coffee create mode 100644 test-reports.xml diff --git a/chap3.rkt b/chap3.rkt new file mode 100644 index 0000000..c1c42a9 --- /dev/null +++ b/chap3.rkt @@ -0,0 +1,10 @@ +(define (find-symbol id tree) + (call/cc + (lambda (exit) + (define (find tree) + (if (pair? tree) + (or (find (car tree)) (find (cdr tree))) + (if (eq? tree id) (exit #t) #f))) + (find tree)))) + + diff --git a/chapter3/interpreter.coffee b/chapter3/interpreter.coffee index 03e4c1e..8c77e2c 100644 --- a/chapter3/interpreter.coffee +++ b/chapter3/interpreter.coffee @@ -60,7 +60,7 @@ extend = (env, variables, values) -> nil make_function = (variables, body, env, callback) -> - callback (values) -> eprogn body, (extend env, variables, values) + callback (values, cb) -> eprogn body, (extend env, variables, values), cb invoke = (fn, args, callback) -> fn args, callback diff --git a/chapter3/test.coffee b/chapter3/test.coffee new file mode 100644 index 0000000..c756022 --- /dev/null +++ b/chapter3/test.coffee @@ -0,0 +1,6 @@ +{cons} = require "cons-lists/lists" +lisp = require '../chapter3/interpreter' +{read, readForms} = require '../chapter1/reader' +{inspect} = require 'util' + +lisp read('(begin ((lambda () (+ 5 5))))'), (x) -> console.log(x) diff --git a/test-reports.xml b/test-reports.xml new file mode 100644 index 0000000..c3dbab9 --- /dev/null +++ b/test-reports.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +