git » jacl.git » commit c59a854

repl fixes, but webserver must be running

author Alan Dipert
2020-01-29 06:04:44 UTC
committer Alan Dipert
2020-01-29 06:04:44 UTC
parent 68bb9b05bd899b71ca567adb026ee633a8d48696

repl fixes, but webserver must be running

jacl.js +3 -24
repl-client/jacl-client.R +1 -1

diff --git a/jacl.js b/jacl.js
index c0db4a8..e4161d7 100644
--- a/jacl.js
+++ b/jacl.js
@@ -2012,11 +2012,11 @@ const startRepl = async () => {
   try {
     for await(const obj of replReader) {
       const node = analyze(emptyEnv, null, obj);
-      //console.log(node)
+      console.log(node)
       const sb = new StringBuffer();
       emitNode(sb.append.bind(sb), node);
       const code = sb.toString();
-      //console.log('code="',code,'"');
+      console.log('code="',code,'"');
       const result = eval(code);
       console.log(result);
     }
@@ -2051,26 +2051,5 @@ const loadLispScripts = async () => {
 window.addEventListener('load', async () => {
   await loadLispScripts();
   QUnit.start();
-  startRepl();
+  await startRepl();
 });
-
-//var buf = new BufferedStream(),
-//    rdr = new Reader(buf);
-//
-//(async function() {
-//  for await(const obj of rdr) {
-//    console.log('read:', obj);
-//    const node = analyze(emptyEnv, null, obj);
-//    console.log('analyzed:', node);
-//    const sb = new StringBuffer();
-//    emitNode(sb.append.bind(sb), node);
-//    const code = sb.toString();
-//    console.log('generated:', code);
-//    const evald = eval(code);
-//    console.log('evaled:', evald);
-//    //console.log('parsed', parseLambdaList(evald));
-//  }
-//})()
-
-// buf.writeEach(String.raw`(\. (js |window|) (|alert| (to-js "hello, world!")))`)
-// buf.writeEach('(jacl::%call (jacl::%dot js::|window| |alert|) "hi")')
diff --git a/repl-client/jacl-client.R b/repl-client/jacl-client.R
index d5f36c4..683f378 100755
--- a/repl-client/jacl-client.R
+++ b/repl-client/jacl-client.R
@@ -12,7 +12,7 @@ invisibly <- function(expr) {
 # TODO figure out how to use Log instead of deprecated Console
 invisibly({
   b <- ChromoteSession$new()
-  b$Page$navigate("file:///home/alan/github/alandipert/jacl/index.html")
+  b$Page$navigate("http://rstudio.local:8000")
   b$Console$messageAdded(function (msg) { 
     cat(msg$message$text)
     cat('\n> ')