Merge branch 'lisp-repl'
authorDavid Vázquez <davazp@gmail.com>
Wed, 19 Feb 2014 02:09:33 +0000 (03:09 +0100)
committerDavid Vázquez <davazp@gmail.com>
Wed, 19 Feb 2014 02:09:33 +0000 (03:09 +0100)
Conflicts:
jscl.html
src/toplevel.lisp

jscl.html
src/toplevel.lisp
tests-report.lisp
tests.html
tests.lisp

index a8d109b..4e29546 100644 (file)
--- a/jscl.html
+++ b/jscl.html
@@ -1,72 +1,13 @@
 <!doctype html>
 <html>
   <head>
-    <style>
-     /* The console container element */
-    body { background-color: black; font-size: 16px; font-family: Courier; overflow: hidden; padding: 0 0 0 0;}
-    #console {
-      position: absolute;
-      top: 0px;
-      bottom: 0px;
-      left: 0px;
-      right: 0px;
-      background-color:black;
-    }
-
-    .parents {
-        font-weight: bold;
-    }
-
-    /* The inner console element. */
-    .jqconsole {
-        padding: 10px;
-    }
-    /* The cursor. */
-    .jqconsole-cursor {
-        background-color: gray;
-    }
-    /* The cursor color when the console looses focus. */
-    .jqconsole-blurred .jqconsole-cursor {
-        background-color: #666;
-    }
-    /* The current prompt text color */
-    .jqconsole-prompt {
-        color: White;
-    }
-    /* The command history */
-    .jqconsole-old-prompt {
-        color: White;
-        font-weight: normal;
-    }
-    /* The text color when in input mode. */
-    .jqconsole-input {
-        color: White;
-    }
-    /* Previously entered input. */
-    .jqconsole-old-input {
-        color: White;
-        font-weight: normal;
-    }
-    /* The text color of the output. */
-    .jqconsole-output {
-        color: green;
-    }
-    .jqconsole-return, .jqconsole-header {
-        color: gray;
-    }
-    .jqconsole-error {
-        color: red;
-    }
-</style>
+    <link rel="stylesheet" href="style.css">
   </head>
-
   <body>
     <div id="console"></div>
     <script src="jquery.js" type="text/javascript" charset="utf-8"></script>
-    <script src="jscl.js" type="text/javascript"></script>
     <script src="jqconsole.min.js" type="text/javascript" charset="utf-8"></script>
-    <script>
-      var jqconsole = $('#console').jqconsole(';; Welcome to JSCL!\n\n', '');
-    </script>
+    <script>var jqconsole = $('#console').jqconsole(';; Welcome to JSCL!\n\n', '');</script>
+    <script src="jscl.js" type="text/javascript"></script>
   </body>
 </html>
index 42864e6..3c38003 100644 (file)
     (#j:jqconsole:Prompt t #'process-input)))
 
 
-;;; KLUDGE: I tried
-;;; 
-;;;   (#j:document.addEventListener "load" #'topevel nil)
-;;; 
-;;; but it is not working. So I am using this temporarily to wait
-;;; until the DOM is ready before starting the REPL.
+(defun init (&rest args)
+  (#j:jqconsole:RegisterMatching "(" ")" "parents")
+  (load-history)
+  (toplevel))
 
-(#j:setTimeout (lambda ()
-                 (#j:jqconsole:RegisterMatching "(" ")" "parents")
-                 (load-history)
-                 (toplevel))
-               0)
+(#j:window:addEventListener "load" #'init)
index 19a95a7..1b44496 100644 (file)
@@ -10,3 +10,5 @@
 
 (unless (zerop *unexpected-passes*)
   (format t "~a test(s) passed unexpectedly.~%" *unexpected-passes*))
+
+(terpri)
index 92a5f13..b814558 100644 (file)
@@ -1,76 +1,14 @@
 <!doctype html>
 <html>
   <head>
-    <style>
-     /* The console container element */
-    body { background-color: black; font-size: 16px; font-family: Courier; overflow: hidden; padding: 0 0 0 0;}
-    #console {
-      position: absolute;
-      top: 0px;
-      bottom: 0px;
-      left: 0px;
-      right: 0px;
-      background-color:black;
-    }
-
-    .parents {
-        font-weight: bold;
-    }
-
-    /* The inner console element. */
-    .jqconsole {
-        padding: 10px;
-    }
-    /* The cursor. */
-    .jqconsole-cursor {
-        background-color: gray;
-    }
-    /* The cursor color when the console looses focus. */
-    .jqconsole-blurred .jqconsole-cursor {
-        background-color: #666;
-    }
-    /* The current prompt text color */
-    .jqconsole-prompt {
-        color: White;
-    }
-    /* The command history */
-    .jqconsole-old-prompt {
-        color: White;
-        font-weight: normal;
-    }
-    /* The text color when in input mode. */
-    .jqconsole-input {
-        color: White;
-    }
-    /* Previously entered input. */
-    .jqconsole-old-input {
-        color: White;
-        font-weight: normal;
-    }
-    /* The text color of the output. */
-    .jqconsole-output {
-        color: green;
-    }
-    .jqconsole-return, .jqconsole-header {
-        color: gray;
-    }
-    .jqconsole-error {
-        color: red;
-    }
-</style>
+    <link rel="stylesheet" href="style.css">
   </head>
   <body>
     <div id="console"></div>
     <script src="jquery.js" type="text/javascript" charset="utf-8"></script>
     <script src="jqconsole.min.js" type="text/javascript" charset="utf-8"></script>
+    <script>var jqconsole = $('#console').jqconsole('Running test suit...', '');</script>
     <script src="jscl.js" type="text/javascript"></script>
-    <script>
-      var jqconsole = $('#console').jqconsole();
-      lisp.write = function(str){
-           jqconsole.Write(xstring(str), 'jqconsole-output', false);
-           return str;
-      };
-    </script>
     <script src="tests.js" type="text/javascript"></script>
   </body>
 </html>
index a09ee75..1eca341 100644 (file)
@@ -41,5 +41,6 @@
 (defmacro test-equal (form value)
   `(test (equal ,form, value)))
 
-(format t "Running tests...~%~%")
 (setq *timestamp* (get-internal-real-time))
+
+(terpri)