Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.07 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>Scheme</title>
  4.     <script type = "text/javascript" src = "http://www.biwascheme.org/repos/release/biwascheme-min.js" ></script>
  5.     <script type="text/javascript" src="https://raw.github.com/yhara/biwascheme/master/src/development_loader.js"></script>
  6.     <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
  7. </head>
  8. <body>
  9.     <textarea rows = 20 cols = 50 id = "input"></textarea>
  10.     <div id = "output">Result should appear here</div>
  11.     <input type = "button" id = "eval_btn" value = "Evaluate"></input>
  12.    
  13.     <script>
  14.         var intepreter = new BiwaScheme.Interpreter();
  15.         var input = $("#input");
  16.         var output = $("#output");
  17.         function scheme_eval() {
  18.             interpreter.evaluate(input.val(),
  19.                function(result) {
  20.                    if (result != undefined) {
  21.                     alert("Evaluating");
  22.                        result = BiwaScheme.to_write(result);
  23.                        output[0].innerHTML += '> ' + result;
  24.                    }
  25.               });
  26.         }
  27.         $("#eval_btn").click(function() {
  28.             scheme_eval();
  29.         });
  30.     </script>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement