Hi Adrian:

Not sure how long you've been working with Julia but I also was looking for 
nargin from Matlab when I recently converted to Julia. I figure I would post 
this for other newbies in my situation.  I had a lot of Matlab code like the 
following 

function y = foo(x, z)
        if nargin > 1
                ... do something with x and z ..
        else
            .... do something with x ...
        end
end

Then I realized the multiple dispatch approach of Julia make this much more 
clean. So in julia I would write

function foo(x)
        .... do something with x ...
end
function foo(x, z)
        .... do something with x and z ..
end


Cheers,
Ethan


Reply via email to