Skip to content

Use colons before blocks #34

Open
Open
@SnirkImmington

Description

@SnirkImmington

Do things the Python way:

Instead of

fn foo(a: int, b: int) -> int
    // do some stuff

Do

fn foo(a: int, b: int) -> int:
    // do some stuff

This applies to block level constructs:

if cond:
    do:
        // some stuff
else:
    // other stuff

I think that the : ultimately provides more readability and appearance of structure. Now the symmetry is that : is used before a block but => is used to represent that code inline.

This does mean we have to be careful of : in expressions. However, as with Python, I don't think it will come up much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ASTIssues which affect AST codearea: parseThe parsing of source code within the compilerarea: syntaxSyntactical changes to the languagepoints: 1Simple or straightforward changes to the codepriority: highImportant requirements, goals, and features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions