| ParenScript | JavaScript |
|---|---|
(alert (+ 1 1)) |
alert(1 + 1); |
(defun factorial (n)
(if (< n 1)
1
(* n (factorial (- n 1))))) |
function factorial(n) {
if (n < 1) {
return 1;
} else {
return n * factorial(n - 1);
}
} |
(@ ($ "div") length) |
$("div").length; |
(chain ($ "h1")
(css "color" "green")
(html "Header 1")
(click (lambda ()
(alert "Clicked!")))) |
$("h1").css("color", "green")
.html("Header 1")
.click(function () {
alert("Clicked!");
}); |
This site was developed by Nick Fitzgerald using ParenScript, Node JS, and jQuery Console. To learn more about ParenScript, dive in to the tutorial. The source for this site is hosted on GitHub. Pull requests welcome!
Unfortunately, defmacro and friends are not currently
supported since I haven't found a way to "sandbox" Common Lisp
effectively, and anyone would be able to run arbitrary code on my
server.