Skip to content

Commit

Permalink
core: Add ys::std/split with string and re swappable
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Jun 18, 2024
1 parent b3a78e0 commit 39705d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/ys/std.clj
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@
(defn sleep [s]
(Thread/sleep (int (* 1000 s))))

(defn split
([s] (clojure.string/split s #""))
([s r]
(let [[s r] (if (= java.util.regex.Pattern (type s)) [r s] [s r])
r (if (string? r) (re-pattern r) r)]
(clojure.string/split s r))))

(defn throw [e] (throw e))

(defn use-pod [pod-name version]
Expand Down

0 comments on commit 39705d7

Please sign in to comment.