Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translating functions with variable number of arguments #9

Open
sbacelar opened this issue May 14, 2019 · 1 comment
Open

Translating functions with variable number of arguments #9

sbacelar opened this issue May 14, 2019 · 1 comment

Comments

@sbacelar
Copy link

In MatLab I found code of the type:

function[x, y]=foo(a,b,c)
    if nargin < 3
       # do something
    end
    if nargin < 2
       # do another thing
    end
end

I think this should be translated into Julia by:

function foo(args...)
    if length(args) <3
        # more code
    return x,y
end

But the automatic translator mantains ´if nargin < ´.

@aminya
Copy link

aminya commented Jul 4, 2019

Yes, I noticed this as well. Translator now just ignores when it does not understand something. This can be enhanced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants