Skip to content

Translating functions with variable number of arguments #9

@sbacelar

Description

@sbacelar

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 < ´.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions