Skip to content

Instantly share code, notes, and snippets.

@damionjunk
Created November 27, 2011 19:14
Show Gist options
  • Save damionjunk/1398003 to your computer and use it in GitHub Desktop.
Save damionjunk/1398003 to your computer and use it in GitHub Desktop.
Provide the balancing closers.
(defn b-closers
"Provides the 'brackets' necessary to close the given string."
[s & {:keys [ls rs] :or {ls \[ rs \]}}]
(map #(if (= ls %) rs ls) (b-reduction s)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment