Skip to content

Commit

Permalink
lispy-clojure.clj (flatten-expr): Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
abo-abo committed Mar 2, 2016
1 parent 6df13fd commit 8014eb0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lispy-clojure.clj
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@
func-args (first func-body)
func-impl (rest func-body)]
(cons 'let
(cons (vec (if (some #{'&} func-args)
(cons (vec (if (some #{'&} [func-args])
(vector func-args (vec args))
(interleave func-args args)))
(apply concat
(filter (fn [[a b]]
(not (= a b)))
(partition
2 (interleave func-args args))))))
func-impl))))

(defn quote-maybe
Expand Down

0 comments on commit 8014eb0

Please sign in to comment.