diff options
Diffstat (limited to 'spec/05-classes-and-objects.md')
-rw-r--r-- | spec/05-classes-and-objects.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/05-classes-and-objects.md b/spec/05-classes-and-objects.md index f92e88788a..d1a1a8739d 100644 --- a/spec/05-classes-and-objects.md +++ b/spec/05-classes-and-objects.md @@ -27,7 +27,7 @@ SelfType ::= id [`:' Type] `=>' | this `:' Type `=>' ``` -A template defines the type signature, behavior and initial state of a +A _template_ defines the type signature, behavior and initial state of a trait or class of objects or of a single object. Templates form part of instance creation expressions, class definitions, and object definitions. A template @@ -972,7 +972,7 @@ TraitDef ::= id [TypeParamClause] TraitTemplateOpt TraitTemplateOpt ::= `extends' TraitTemplate | [[`extends'] TemplateBody] ``` -A trait is a class that is meant to be added to some other class +A _trait_ is a class that is meant to be added to some other class as a mixin. Unlike normal classes, traits cannot have constructor parameters. Furthermore, no constructor arguments are passed to the superclass of the trait. This is not necessary as traits are @@ -1074,7 +1074,7 @@ in `MyTable`. ObjectDef ::= id ClassTemplate ``` -An object definition defines a single object of a new class. Its +An _object definition_ defines a single object of a new class. Its most general form is `object $m$ extends $t$`. Here, $m$ is the name of the object to be defined, and |