Skip to content

Ability to pass arguments to functions by name #6866

@PLyczkowski

Description

@PLyczkowski

Ability to pass arguments like this:

func foo(val1:String = "c", val2:String = "c"):
    print(val1)
    print(val2)

foo(val2 = "a") # prints "c a"
foo(val2 = "a", val1 = "b") # prints "b a"

Here is the equivalent in python explained: https://treyhunner.com/2018/04/keyword-arguments-in-python/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions