Skip to content

Instantly share code, notes, and snippets.

@rileylev
Created July 27, 2020 22:35
Show Gist options
  • Save rileylev/96a4293f4250f4a93cca4561b6d7ff78 to your computer and use it in GitHub Desktop.
Save rileylev/96a4293f4250f4a93cca4561b6d7ff78 to your computer and use it in GitHub Desktop.
(defgeneric add (x y))
;;; assume we already defined vector and integer classes
(defmethod add ((x vector) (y vector))
....)
(defmethod add ((x integer) (y integer))
(+ x y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment