intro: mention banana-gorilla-jungle problem

This commit is contained in:
Jean-Louis Leroy
2025-04-26 09:15:29 -05:00
parent ec21ceaa05
commit 1dc460bb0c

View File

@@ -9,6 +9,13 @@ the Expression Problem:
to add new operations on the existing types, and new types to the existing
operations, without modifying existing code?
Open-methods also address the banana-gorilla-jungle problem:
> The problem with object-oriented languages is theyve got all this implicit
environment that they carry around with them. You wanted a banana but what you
got was a gorilla holding the banana and the entire jungle. — Joe Armstrong,
creator of Erlang progamming language
As a bonus, open-methods can take more than one argument into account when
selecting the appropriate function to call - aka multiple dispatch. For that
reason, open-methods are often called multi-methods, but that term is