Named arguments without natural defaults in Julia
Could do the following:
function discount_rate(;n=nothing,fv=nothing,pmt=nothing,pv=nothing,pmt_type=0)
if n == nothing || fv == nothing || pmt == nothing || pv == nothing
error("Must provide all arguments")
end
discount_rate(n,fv,pmt,pv,pmt_type=pmt_type)
end
function discount_rate(n, fv, pmt, pv; pmt_type = 0)
#...
end