grenada.utils

Miscellaneous utilities.

clean-up-string

(clean-up-string s)
Removes trailing and leading whitespace and newlines from a string.

Can be used to remove all the garbage from single-paragraph, multiline Clojure
strings.

dissoc-in*

(dissoc-in* m ks)
Like plumbing.core/dissoc-in, but doesn't remove empty maps.

fnk*

macro

(fnk* symv form)
Shortens fnks that just apply some other function to their arguments.

(fnk [x] (inc x)) → (fnk* [x] inc)
(fnk [x] (+ 4 x)) → (fnk* [x] (+ 4))

keyset

(keyset m)
Set of the keys of M.

ordinary-file-seq

(ordinary-file-seq fl)

remove-nth

(remove-nth n coll)
Returns COLL with the item with offset N removed.

Example:
  user=> (remove-nth [0 1 2 3 4 5] 3)
  (0 1 2 4 5)

str-file

(str-file & args)
Like io/file, but (str …)ingifies the resulting File.

warn

(warn & args)
Like clj::clojure.core/println, but outputs to *err*.