Permalink
Browse files

Tidied up parsley.

  • Loading branch information...
1 parent d93dde9 commit b63095c9239b13d17bbab0128fb9a4d11b0cd457 @tcrayford tcrayford committed Sep 11, 2010
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/clojure_refactoring/support/parsley.clj
@@ -4,9 +4,11 @@
[clojure.contrib.def :only [defonce-]]
[clojure.contrib.seq-utils :only [find-first]]
[clojure.contrib.str-utils :only [str-join]])
- (:refer-clojure :exclude [symbol symbol? keyword? list vector newline conj])
+ (:refer-clojure
+ :exclude [symbol symbol? keyword? list vector newline conj])
(:require [clojure.core :as core])
- (:use [clojure-refactoring.support.core :exclude [sub-nodes tree-contains?]])
+ (:use [clojure-refactoring.support.core
+ :exclude [sub-nodes tree-contains?]])
(:require [clojure-refactoring.support.parser :as parser]))
(defn make-node [tag content]
@@ -175,7 +177,9 @@
(defn- expand-args-with-parse1 [args]
"Takes arguments from a function and returns a vector that
(in a let form) rebinds them by parsing them."
- (->> (mapcat #(core/list % (core/list 'clojure-refactoring.support.parser/parse1 %)) args) vec))
+ (->> args
+ (mapcat (fn [arg] `(~arg (parser/parse1 ~arg))))
+ vec))
(defmacro defparsed-fn [name args docstring & body]
"Defines a function in which all of the args are rebound by parsing them using parse1."

0 comments on commit b63095c

Please sign in to comment.