Allowing the object.method(args...) syntax as an alias for method(object, args ...)

It’s true that at the bottom there are often only a few functions that a library needs, but new programmers can be misled by this. Because of multiple dispatch, there are often many higher-level functions that can automatically use the few core functions. And, I believe that proliferation of verbs (e.g. IterTools.jl) that work on a simple interface is a very good thing. The alternative to many functions is few functions with messy semantics, and that should be avoided.

The way to have clear and composable APIs is to have a lot of distinguishable functions with clear contracts. In Julia, those functions can all act on many data types automatically, but that should not obscure the guiding principle that a function should do one thing clearly.

I want more verbs!

3 Likes