Trait Statement

Makes a trait, a construct that changes how a class behaves.

Syntax

[ @Abstract ] Trait trait_name [ type_list ] [ Does parent_trait ]…
    [ Where generic_constraints ]
    …
    [ statements ]
End [ Trait ]

Parts

@Abstract
Optional modifier specifies that the trait contains only signatures of procedures, not executable statements or variables.
trait_name
Mandatory name for the trait
type_list
Optional one or more type parameters, with a comma between each, all between brackets ([ ]). See Type List for more information.
Does
Optional, you can use again and again.
parent_trait
Mandatory after Does, a different trait from which trait_name inherits methods.
Where
Optional, you can use again and again. See Where Clause (Generics) for more information.
statements
Optional declarative statements.
End
Completes the statement. You can also use End Trait.
You can change this part of the syntax. See @Option Directive for more information.

Instructions

TODO

Examples

TODO

See also