Best practice for user-customizable methods

Do you need the user to have complete control of the function? One way that packages like Plots and Latexify deal with customization is to have a global (gasp) Dict of defaults, which you edit with a user-facing setter.

For your usecase, that could be

export set_mytype_prefix
global mytype_prefix = Ref{String}("lala")
function set_mytype_prefix(new)
    mytype_prefix[] = new
end
Watson.default_prefix(c::MyType) = mytype_prefix[]
2 Likes