hy/site/templates/index.html

44 lines
1.1 KiB
HTML
Raw Normal View History

2013-03-10 04:54:29 +01:00
{% extends "base.html" %}
{% block title %}Welcome!{% endblock %}
{% block content %}
2013-03-10 17:59:16 +01:00
2013-03-10 20:17:16 +01:00
{# {% autoescape off %}{% code "clojure" %}
2013-03-10 17:59:16 +01:00
(print "foo bar")
2013-03-10 20:17:16 +01:00
{% endcode %}{% endautoescape %} #}
2013-03-10 20:30:49 +01:00
<div id = 'popshim' >
<div class = 'popover' >
<div class = 'focus' >
2013-03-10 20:17:16 +01:00
<div class = 'repl' >
<textarea id = 'repl-input' class = 'repl-pane repl-left' >
2013-03-10 20:32:27 +01:00
; Very much a knockoff (straight port) of Dan Gulotta's 2013 MIT Mystery Hunt
; puzzle "The Halting Problem".
2013-03-10 20:17:16 +01:00
2013-03-10 20:32:27 +01:00
(defn evaluate [f] ((f (lambda [x] (+ x 1))) 0))
(defn successor [n] (lambda [f] (lambda [x] (f ((n f) x)))))
(defn plus [m n] ((n successor) m))
(defn exponent [m n] (n m))
(defn zero [f] (lambda [x] x))
(defn one [f] (lambda [x] (f x)))
(defn predecessor [n] (lambda [f] (lambda [x]
(((n (lambda [g] (lambda [h] (h (g f))))) (lambda [y] x)) (lambda [z] z)))))
(defn subtract [m n] ((m predecessor) n))
(def two (plus one one))
(def three (plus two one))
(print (evaluate (exponent three three)))
2013-03-10 20:17:16 +01:00
</textarea>
2013-03-10 20:30:49 +01:00
<pre id = 'repl-output' class = 'repl-pane repl-right' ></pre>
</div>
</div>
</div>
2013-03-10 17:59:16 +01:00
2013-03-10 04:54:29 +01:00
{% endblock %}