Hi, I have a complicated function which has enough arguments that I want to use keyword args, and I want to have some default values, and in the early stages I like to use Unitful to help me catch dimensional errors, but at other times I would like to be able to just use SI throughout and drop all the clutter of the units.
I can do that in the following way:
f_(a,b) = a+b # imagine a bit more complexity here! f(a,b=1.0) = f_(a,b) f(a::Quantity,b::Quantity = 1.0u"m") = f_(a,b)
f(2.0u"mm") both do what I would want.
I feel like there should be a way for multiple dispatch to solve this for me, but in my attempts I’ve only figured out new ways to generate a stack overflow.
[EDIT: simplified MWE]