Skip to content

Syntax for assignment #23

@BraedonWooding

Description

@BraedonWooding

Related to #8, #11

Current assignment rules dictate;

X.a = 5
// You can specify type
X.a : int = 5

However the syntax for defining a literal or a 'definition' is x : T = a which can be shortened to x := a, should we also follow suit and make assignments X.a := 5?? Or should we just automatically infer and make it just ? = ?? everywhere i.e. x = a or X.a = 5 or X = B::().

If so then what do we mean for X = B::() if X is defined vs not defined, are we assigning the label 'X' or are we assigning what X points to i.e. something more like *X = B::()?

Could we also allow X : B { ... } rather than requiring X = B::() { ... } since I don't like X = B { ... }, this would also basically help with backwards compatibility of v0.3 however we aren't ensuring that we have to be compatible just yet.

Very interesting, and I'm not settled on an answer yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions