While Common Lisp's CLOS is often referred to as OOP, it's definitely less coupled than single dispatch.
While Common Lisp's CLOS is often referred to as OOP, it's definitely less coupled than single dispatch.
What I find limiting is easy access to efficient, immutable data structures. Ocaml leaves you with the option to switch to mutable data structures at the cost of safety, and Haskell provides things like the ST monad for handling mutable updates safely at the cost of type-level complexity.
And solving the same kind of problems without polymorphism (be that multiple dispatch, type classes or otherwise), is a struggle.
Protocols or typeclasses are also ways to implement functionality over (usually) immutable data. I don't see the relation to a mutable object with a closed set of methods defined at compile time.
Go back to my original comment and you'll see that multiple dispatch is what got us here.
I never said anything about mutable/immutable data, I'm talking about polymorphism. But I did mention type classes as an alternative.
I frankly fail to see how this is leading anywhere.
Multiple dispatch means functions are generic, and all arguments are considered when deciding which implementation to call.
Snigl supports both multiple dispatch and pattern matching, as does Common Lisp.