Skip to content

[Feature Request] Allow Move variables to begin with a capital letterΒ #19138

@vineethk

Description

@vineethk

πŸš€ Feature Request

Move disallows variables starting from a capital letter, e.g., let G = 2;.

This was likely a design decision to make parsing unambiguous (as done in other languages like Haskell, OCaml). Consider, eg.,

struct S;

fun make_S(): S {
    S
}

public fun test() {
    let S = make_S(); // are we assigning to a variable or destructing `S`?
}

Right now, when you have let S = make_S();, we know it is destructing syntactically, because of the variable naming restriction. So this complexity needs to be considered if we decide to implement this feature request.

Originally requested by @alinush

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    πŸ†• New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions