|
|
|
|
|
by junke
3462 days ago
|
|
No, I was talking about (Common) Lisp's generic functions (http://clhs.lisp.se/Body/m_defgen.htm). I realize I did not give enough context. Define a generic function: (defgeneric garnish (what with-what))
Specialize it on one or multiple arguments: (defmethod garnish ((c cocktail) (f fruit)) ...)
(defmethod garnish ((s sandwich) (h ham)) ...)
...
But you can use it like a function: (let ((currified (rcurry #'garnish :curry)))
(map 'list currified items))
|
|
These look very much like Clojure's protocols and multi-methods.