I have a function with two outputs. The second one is computationally 
expensive, so I want to avoid the computation unless the user needs it. I 
read on another post in the group that the solution in this case is usually 
to define two functions, but in this case I basically need to do all the 
computations for the first output to compute the second. Is there any nicer 
way to do this in julia? In MATLAB, I would just say:

If nargout > 1
    # do all the computations for second output
end

Reply via email to