Skip to content

Instantly share code, notes, and snippets.

@mdemare
Created November 9, 2009 20:09
Show Gist options
  • Save mdemare/230243 to your computer and use it in GitHub Desktop.
Save mdemare/230243 to your computer and use it in GitHub Desktop.
;; original
(defn left-s [s length]
(subs s 0 (if (< length 0) (+ length (count s)) length)))
;; generates assert-equal everytime it's called
(defn left-s [s length]
(let [rvalue
(subs s 0 (if (< length 0) (+ length (count s)) length))]
(println "\n(assert-equal" (pr-str rvalue) "(left-s" (pr-str s) length "))")
rvalue))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment