Optional argument is a struct

I’ll share some advice I was given.

  1. Define a function _fun that does the bulk of the work. Then have methods fun(a, b, c) and fun(a, b) both call _fun internally but with different pre- and post-processing above and below respectively.
  2. You can use a distinct struct rather than nothing to define methods for your different cases: Application Code Organization - #15 by lmiq.
2 Likes