diff --git a/eg/flask/app.hy b/eg/flask/app.hy new file mode 100644 index 0000000..8d9c594 --- /dev/null +++ b/eg/flask/app.hy @@ -0,0 +1,13 @@ +; Copyright (c) Paul R. Tagliamonte , 2013 under the terms of +; hy. + +(import-from flask + Flask render-template) + + +(def app (Flask "__main__")) + + +(decorate-with (.route app "/") + (defn index [] + (render-template "index.html"))) diff --git a/eg/flask/shim.py b/eg/flask/shim.py new file mode 100644 index 0000000..4472877 --- /dev/null +++ b/eg/flask/shim.py @@ -0,0 +1,5 @@ +import hy.lang.importer +from app import app + +if __name__ == '__main__': + app.run(debug=True) diff --git a/eg/flask/templates/index.html b/eg/flask/templates/index.html new file mode 100644 index 0000000..dd60957 --- /dev/null +++ b/eg/flask/templates/index.html @@ -0,0 +1 @@ +

It works!

diff --git a/eg/repl.hy b/eg/repl.hy deleted file mode 100644 index e57cc71..0000000 --- a/eg/repl.hy +++ /dev/null @@ -1,6 +0,0 @@ -; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp -; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all -; copyrightable. - -(loop (print (eval (read)))) -; Yes folks, this is where REPL comes from. diff --git a/eg/yo-dawg.hy b/eg/yo-dawg.hy deleted file mode 100644 index 54e3a12..0000000 --- a/eg/yo-dawg.hy +++ /dev/null @@ -1,10 +0,0 @@ -; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp -; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all -; copyrightable. - -(import ["json"]) - -(print "I'll eval s-expressions you input") -(loop (print - (kwapply (json.dumps - (lex (read))) {"sort_keys" true "indent" 4})))