making the example look nicer.
This commit is contained in:
parent
c13d181361
commit
e4c91b3917
|
@ -8,4 +8,4 @@
|
|||
(* x (fact (sub1 x)))]))
|
||||
|
||||
|
||||
(printf "test: ~s\n" (fact 4))
|
||||
;;(printf "test: ~s\n" (fact 4))
|
|
@ -3,29 +3,27 @@
|
|||
|
||||
<script src="runtime.js"></script>
|
||||
<script src="fact.js"></script>
|
||||
<script>
|
||||
plt.runtime.invokeMains();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
plt.runtime.invokeMains();
|
||||
|
||||
plt.runtime.ready(function() {
|
||||
var myFactClosure = plt.runtime.lookupInMains('fact');
|
||||
var myFact = plt.baselib.functions.asJavaScriptFunction(
|
||||
myFactClosure);
|
||||
|
||||
|
||||
$(document.body).append("The factorial of 1000 is: ");
|
||||
myFact(function(v) {
|
||||
$(document.body).append(v.toString());
|
||||
$('#answer').text(v.toString());
|
||||
},
|
||||
function(err) {
|
||||
$(document.body).append(err);
|
||||
$('#answer').text(err.message);
|
||||
},
|
||||
1000);
|
||||
10000);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
The factorial of 10000 is <span id="answer">being computed</span>.
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue
Block a user