Skip to content

Commit

Permalink
add interpreter for hy (#4158)
Browse files Browse the repository at this point in the history
* add interpreter for hy

* add a more realistic sample using shebang for Hy
  • Loading branch information
TypicalFence authored and lildude committed Jul 21, 2018
1 parent 21568a7 commit 73972dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,8 @@ Hy:
color: "#7790B2"
extensions:
- ".hy"
interpreters:
- "hy"
aliases:
- hylang
tm_scope: none
Expand Down
10 changes: 10 additions & 0 deletions samples/Hy/fizzbuzz
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env hy
(defn fizz [] (print "Fizz"))
(defn buzz [] (print "Buzz"))
(defn fizzbuzz [] (print "FizzBuzz"))

(defmain [&rest args] (for [i (range 1 21)]
(cond [(and (= 0 (% i 3)) (= 0 (% i 5))) (fizzbuzz)]
[(= 0 (% i 3)) (fizz)]
[(= 0 (% i 5)) (buzz)]
[True (print i)])))

0 comments on commit 73972dc

Please sign in to comment.