In C++11, one can initialize the fields of a class to avoid boiler plate code. In Julia, I am currently typing every single combination of constructors in order to handle default values, for example:
You specify nowhere what T is, so how is it supposed to know? (In that setup, you want those all UInt128, right?) At least one default must determine T, otherwise there’s no way to know what it means.
Anything that uses keyword arguments won’t dispatch, so if keyword arguments are used for the defaults it will not be type stable if you want to have a type parameter. Keyword argument dispatch will be a thing “soon”, so Parameters.jl will be able to handle that in the future, but for now you just have to live with it. That PR is really far along (it’s the one with NamedTuples) and it keeps getting mentioned, so I really think it will be 1.0 material. So I would just design with that in mind.
Default arguments are not a good option though because then the order matters. But if you want the default argument approach, then that’s easy to do by hand: