Add Hy language.

Hy is a dialect of Lisp that’s embedded in Python.
This commit is contained in:
Berker Peksag
2013-12-14 10:43:08 +02:00
parent 23a1ae5085
commit 89f4885b62
3 changed files with 29 additions and 0 deletions

13
samples/Hy/hello-world.hy Normal file
View File

@@ -0,0 +1,13 @@
;; The concurrent.futures example in Hy.
(import [concurrent.futures [ThreadPoolExecutor as-completed]]
[random [randint]]
[sh [sleep]])
(defn task-to-do []
(sleep (randint 1 5)))
(with-as (ThreadPoolExecutor 10) executor
(setv jobs (list-comp (.submit executor task-to-do) (x (range 0 10))))
(for (future (as-completed jobs))
(.result future)))