Wrapper functions guidlines

  1. Same as for writing efficient code in general. Start with Performance Tips · The Julia Language

  2. No, an if ... elseif ... else ... end branch inside the function has nothing to do with methods, it is just a branch. May be fine, but can also be less flexible if you need to extend it. Various other design patterns are possible, see Methods · The Julia Language

  3. outer(args...) = inner(args...)

  4. const zerosM = zeros

  5. just throw an error, eg

    zerosM(_...) = error("Toto, I have a feeling we're not in Matlab anymore.")
    

Hope this helps. However, from your questions it looks like you are just learning Julia. Consider just using it as is, instead of tailoring it to resemble Matlab.

4 Likes