Is C# a single dispatch or multiple dispatch language?

OK, I understood the subtle difference where function overloading is different from multiple-dispatch. Basically, the difference is whether which method to call is chosen at run-time or compile-time. Now, I know everybody’s said this, but without a clear example this sounds VERY obvious, given that C# is statically typed and multiple-dispatch languages (apparently to me, … Read more

How to create a “single dispatch, object-oriented Class” in julia that behaves like a standard Java Class with public / private fields and methods

While of course this isn’t the idiomatic way to create objects and methods in julia, there’s nothing horribly wrong with it either. In any language with closures you can define your own “object systems” like this, for example see the many object systems that have been developed within Scheme. In julia v0.5 there is an … Read more

How can I use functools.singledispatch with instance methods?

Update: As of Python 3.8, functools.singledispatchmethod allows single dispatch on methods, classmethods, abstractmethods, and staticmethods. For older Python versions, see the rest of this answer. Looking at the source for singledispatch, we can see that the decorator returns a function wrapper(), which selects a function to call from those registered based on the type of … Read more