Merge branch 'master' of github.com:paultag/hy

This commit is contained in:
Paul Tagliamonte 2013-01-04 19:50:02 -05:00
commit b9e0084b76
5 changed files with 19 additions and 16 deletions

13
eg/flask/app.hy Normal file
View File

@ -0,0 +1,13 @@
; Copyright (c) Paul R. Tagliamonte <tag@pault.ag>, 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")))

5
eg/flask/shim.py Normal file
View File

@ -0,0 +1,5 @@
import hy.lang.importer
from app import app
if __name__ == '__main__':
app.run(debug=True)

View File

@ -0,0 +1 @@
<h1>It works!</h1>

View File

@ -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.

View File

@ -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})))