Skip to content

Commit

Permalink
c.c.string migration changes; fixes #70
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Sierra <mail@stuartsierra.com>
  • Loading branch information
pjt authored and Stuart Sierra committed Feb 3, 2010
1 parent 9b194df commit af788ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/main/clojure/clojure/contrib/command_line.clj
Expand Up @@ -13,7 +13,7 @@
:doc "Process command-line arguments according to a given cmdspec"}
clojure.contrib.command-line
(:require (clojure.contrib [seq :as su]))
(:use (clojure.contrib [string :only (str-join)])))
(:use (clojure.contrib [string :only (join)])))

(defn make-map [args cmdspec]
(let [{spec true [rest-sym] false} (su/group-by vector? cmdspec)
Expand Down Expand Up @@ -49,13 +49,13 @@
[spec & rows]
(let [maxes (vec (for [n (range (count (first rows)))]
(apply max (map (comp count #(nth % n)) rows))))
fmt (str-join " "
fmt (join " "
(for [n (range (count maxes))]
(str "%"
(when-not (zero? (maxes n))
(str (when (= (spec n) :l) "-") (maxes n)))
"s")))]
(str-join "\n"
(join "\n"
(for [row rows]
(apply format fmt row)))))

Expand All @@ -77,7 +77,7 @@
(str (first argnames)))
argnames (map (comp rmv-q str) argnames)
argnames
(str-join ", "
(join ", "
(for [arg argnames]
(if (= 1 (count arg))
(str "-" arg)
Expand Down
8 changes: 4 additions & 4 deletions src/main/clojure/clojure/contrib/repl_utils.clj
Expand Up @@ -17,21 +17,21 @@
(clojure.lang RT Compiler Compiler$C))
(:use [clojure.contrib.seq :only (indexed)]
[clojure.contrib.javadoc.browse :only (browse-url)]
[clojure.contrib.string :only (str-join re-sub re-partition)]))
[clojure.contrib.string :as s :only ()]))

;; ----------------------------------------------------------------------
;; Examine Java classes

(defn- sortable [t]
(apply str (map (fn [[a b]] (str a (format "%04d" (Integer. b))))
(partition 2 (concat (re-partition #"\d+" t) [0])))))
(partition 2 (concat (s/partition #"\d+" t) [0])))))

(defn- param-str [m]
(str " (" (str-join
(str " (" (s/join
"," (map (fn [[c i]]
(if (> i 3)
(str (.getSimpleName c) "*" i)
(str-join "," (replicate i (.getSimpleName c)))))
(s/join "," (replicate i (.getSimpleName c)))))
(reduce (fn [pairs y] (let [[x i] (peek pairs)]
(if (= x y)
(conj (pop pairs) [y (inc i)])
Expand Down
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/contrib/string.clj
Expand Up @@ -201,7 +201,7 @@
before the first match, or an empty string if the beginning of the
string matches.
For example: (partition \"abc123def\" #\"[a-z]+\")
For example: (partition #\"[a-z]+\" \"abc123def\")
returns: (\"\" \"abc\" \"123\" \"def\")"
[#^Pattern re #^String s]
(let [m (re-matcher re s)]
Expand Down

0 comments on commit af788ed

Please sign in to comment.