Skip to content

Instantly share code, notes, and snippets.

@aamedina
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save aamedina/f9c19bddca475262904f to your computer and use it in GitHub Desktop.

Select an option

Save aamedina/f9c19bddca475262904f to your computer and use it in GitHub Desktop.
(def table
(-> (.getDeclaredField clojure.lang.Keyword "table")
(doto (.setAccessible true))
(.get nil)))
(defn candidates
[prefix]
(when (= (first prefix) \:)
(for [[kw _] table
:let [kw-name (name kw)]
:when (.startsWith kw-name (subs prefix 1))]
(str ":" kw-name))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment