Permalink
Browse files

lispy-clojure.clj (flatten-expr): Improve

  • Loading branch information...
1 parent 6df13fd commit 8014eb080adcbef323b663b04adc4af8044f422f @abo-abo committed Mar 2, 2016
Showing with 6 additions and 2 deletions.
  1. +6 −2 lispy-clojure.clj
View
@@ -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

0 comments on commit 8014eb0

Please sign in to comment.