Skip to content

Implicit kwargs object? #2475

@leeola

Description

@leeola

Would it be possible to expose an implicit kwargs, kwargs2, etc object?

For example, currently if you want the kwargs the only .. "clean" way to do it is as follows..

foo = ({bar, baz}) ->
  kwargs = bar: bar, baz: baz
  console.log "kwargs: #{JSON.stringify kwargs}"

Now, the same thing can be achieved without defining kwargs, by using _arg, such as..

foo = ({bar, baz}) ->
  kwargs = _arg
  console.log "kwargs: #{JSON.stringify kwargs}"

But i don't think _arg, _arg1, _arg2, etc, is descriptive enough.. do you? I'm likely in the minority, but wouldn't renaming _arg to kwargs or _kwargs be more intuitive?

I mean, if you know _arg refers to a hidden object variable name, then it is easily made sense of, but if you don't.. the user is left wonder which _arg it is referring to.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions