Advertisement
Guest User

Untitled

a guest
Jan 7th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defmulti apply-expression
  2.   (fn [expr c]
  3.     (if (coll? c)
  4.       :coll
  5.       :default)))
  6.  
  7. (defmethod apply-expression :coll
  8.   [expr c]
  9.   "stub")
  10.  
  11. (defmethod apply-expression :default
  12.   [expr c]
  13.   (let [% (read-string c)]
  14.     (eval (read-string expr))))
  15.  
  16. (apply-expression "(+ % 1)" "1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement