Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

c.c.string migration changes; fixes #70

Signed-off-by: Stuart Sierra <mail@stuartsierra.com>
  • Loading branch information...
commit af788ed71a5c92f32daa5bfc5673455bd8843faa 1 parent 9b194df
Perry Trolard pjt authored stuartsierra committed
8 src/main/clojure/clojure/contrib/command_line.clj
View
@@ -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)
@@ -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)))))
@@ -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)
8 src/main/clojure/clojure/contrib/repl_utils.clj
View
@@ -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)])
2  src/main/clojure/clojure/contrib/string.clj
View
@@ -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)]
Please sign in to comment.
Something went wrong with that request. Please try again.