haskell - Typeclasses in Common Lisp -


i'm wondering if there's way emulate haskell's typeclasses in common lisp.

generic functions allow overloading, , it's possible define types using deftype(which defined membership list of instances, example).

but can't dispatch on type. there way make class subclass(and subtype) of other class after definition(e.g. making cons class subclass of sequence class, without redefining cons)?

thanks.

type classes in haskell means statically implementations "interfaces" in form of dictionaries (similarly how vtables in e.g. c++ used (almost) statically, unlike c++ dynamic dispatch @ runtime). common lisp dynamically typed language such lookup make no sense. can implement own of "type class" implementations (instances) @ runtime — design not hard imagine in language expressive common lisp.

p.s. python's zope has adaption mechanism similar charactetistics, if feel referring existing solution in dynamic setting.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -