Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add "constraint" to glossary.
  • Loading branch information
skids committed Mar 24, 2015
1 parent 87bdef4 commit 103c676
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/Language/glossary.pod
Expand Up @@ -40,6 +40,19 @@ C<f(1|2|3)> call to be internally executed as C<f(1)|f(2)|f(3)>, and the
resulting junction is C<2|4|6>. This process of separating junction
arguments into multiple calls to a function is called I<autothreading>.
=head1 Constraint
Constraints are a restriction placed on acceptable types for a parameter
or subset type. They are introduced with the word C<where>. In the
following example, a constraint is used to make sure an error occurs if
anyone ever calls a subroutine named C<abbreviate> with a string which is
shorter than 10 characters:
sub abbreviate (Str $thing where { .chars >= 10 }) { ... }
The C<Str> in the above example is also a constraint, but is usually
referred to as a "type constraint."
=head1 Instance
An I<instance> of a class is also called an I<object> in some other
Expand Down

0 comments on commit 103c676

Please sign in to comment.