Skip to content

Destructuring into existing variables #3500

@admosity

Description

@admosity

I find myself moving data around a lot in and out of already existing variables, and it seems that the only way to do so is having a series of assignment statements or destructuring first and looping over the new object/array to assign the values.

The proposed syntax would be:

existing.{one,two} = {one:1, two:2, three:3}

for object destructuring and:

existing.[ 0..1 ] = [1,2,3,4,5,6,7]

AND

existing.[ 0, 1, 5] = [1,2,3,4,5,6,7]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions