Skip to content

Instantly share code, notes, and snippets.

@DeLaGuardo
Created July 16, 2020 18:02
Show Gist options
  • Save DeLaGuardo/548b6d0eee2c2d29e308d7ffc2c9d43c to your computer and use it in GitHub Desktop.
Save DeLaGuardo/548b6d0eee2c2d29e308d7ffc2c9d43c to your computer and use it in GitHub Desktop.
(defmulti foo (fn [x & _] x))
(defmethod foo :sum [_ & args] (apply + args))
(apply foo (list* :sum (range 10))) ;; => ok
(apply foo (list* :sum (range 25))) ;; => Invalid arity exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment