Dispatch.jl - A Julia package that makes function dispatching across modules simple, flexible, and efficient

The previous comment’s refactoring implies it, but your example has 2 modules with 2 separate functions of the same name, similar to how 2 classes in a OOP language may encapsulate 2 separate methods of the same name. Julia’s multiple dispatch uses the possibly multiple argument types to select one of the possibly multiple methods of one function, not several functions. The package makes a dispatch system closer to OOP languages, but it’s not idiomatic in Julia.

3 Likes