Skip to content

Is it possible to add or improve the syntax for consecutively defined variables and consecutive assignments? #20451

Closed
@fenginsc

Description

@fenginsc

The current syntax for defining variables/constants doesn't work very well, you either have to write multiple lines or you have to use the deconstruction syntax:

var a = 3
var b = 4
var c = 5
var (d,e) = (6,7)

Can it be written in one of the following forms?

var a = 1, b = 2
var a, b = 1, 2

The assignment syntax doesn't work very well either, you can only assign one value at a time:

var a = 3
var b = 4
a = 4
b = 5

Can it be written in one of the following forms?

(a, b) = (4, 5)
a, b = 4, 5

And the continuous assignment syntax is not currently supported, currently only:

a = 4
b = 4 //or b = a
a = {b = 4; b}

It would be great to support this writing!

a = b = 4

thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions