Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Scheme</title>
- <script type = "text/javascript" src = "http://www.biwascheme.org/repos/release/biwascheme-min.js" ></script>
- <script type="text/javascript" src="https://raw.github.com/yhara/biwascheme/master/src/development_loader.js"></script>
- <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
- </head>
- <body>
- <textarea rows = 20 cols = 50 id = "input"></textarea>
- <div id = "output">Result should appear here</div>
- <input type = "button" id = "eval_btn" value = "Evaluate"></input>
- <script>
- var intepreter = new BiwaScheme.Interpreter();
- var input = $("#input");
- var output = $("#output");
- function scheme_eval() {
- interpreter.evaluate(input.val(),
- function(result) {
- if (result != undefined) {
- alert("Evaluating");
- result = BiwaScheme.to_write(result);
- output[0].innerHTML += '> ' + result;
- }
- });
- }
- $("#eval_btn").click(function() {
- scheme_eval();
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement