• Clojure
  • 10 lines
  • 1 fork
  • Pasted by anonymous on February 27, 2014
(ann map-arg-and-ref [(U (Symbol MapDestructure)) -> '[MapDestructure Symbol]])
(defn map-arg-and-ref
  "Ensure a symbolic argument, arg, can be referred to.
  Returns a tuple with a modifed argument and an argument reference."
  (let [arg (if (and (map? arg) (not (:as arg)))
              (assoc arg :as (gensym "arg"))
        arg-ref (if (map? arg) (:as arg) arg)]
    [arg arg-ref]))

Did you know? CLOSE

  • There are keyboard shortcuts!
    • When Creating A Paste
      • ALT+P Toggle Private
      • CTRL+Enter Create Paste
      • ALT+W Toggle word wrap
    • When Viewing A Paste
      • ALT+G Go to a line
      • ALT+CTRL+E Edit the paste
      • ALT+R Show the raw code
  • There are URL options!
    • When Creating A Paste
      • ?lang=Javascript to default to javascript
    • When Viewing A Paste
      • #L-N Jump to line number N