Skip to content

Change the syntax of traits from 'is foo(val)' to '@Foo(val)', and let them precede the thing they annotate #257

@masak

Description

@masak

Following Python and Java's lead. Even TypeScript and ES.next, and (modulo a slight difference in syntax) C#.

Not sure I can fully motivate why I want to make this change, but (a) it feels a little bit more robust in some way, and (b) it's becoming clear that we can have use for traits on a number of things besides subs/macros:

  • Classes
  • Class properties

An example of the former: @Abstract; instead of making it a keyword. An example of the latter: @Readonly. Maybe @Lazy too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions