at:tutorial:appendix
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
at:tutorial:appendix [2008/07/10 16:31] – added tvcutsem | at:tutorial:appendix [2008/07/10 16:39] – added tvcutsem | ||
---|---|---|---|
Line 536: | Line 536: | ||
You can also force a '' | You can also force a '' | ||
- | * '' | + | |
- | | + | * '' |
More usage examples of structural types can be found in the unit test defined in the file '' | More usage examples of structural types can be found in the unit test defined in the file '' | ||
==== Traits ==== | ==== Traits ==== | ||
+ | |||
+ | The module ''/ | ||
+ | |||
+ | Using the '' | ||
+ | |||
+ | To define a " | ||
+ | < | ||
+ | trait: { | ||
+ | ... | ||
+ | } requiring: Protocol; | ||
+ | </ | ||
+ | |||
+ | The above code creates a trait that can only be composed into an object adhering to the specified protocol. To compose traits, use the following language construct: | ||
+ | |||
+ | < | ||
+ | object: { | ||
+ | use: { | ||
+ | import T1 exclude ...; | ||
+ | import T2 alias ...; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The '' | ||
+ | |||
+ | Note that the place where '' | ||
+ | |||
+ | Usage examples can be found in the unit tests in the file '' |
at/tutorial/appendix.txt · Last modified: 2021/09/24 10:28 by elisag