Skip to content

Commit

Permalink
[6.d] Document DefiniteHOW's new default defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Sep 20, 2018
1 parent 1521c9f commit 44ac0f9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/Type/Signature.pod6
Expand Up @@ -373,6 +373,20 @@ which is in part clarified by the different way default values are
declared in each case (using C<=> for parameters, using the C<default>
trait for variables).
Note: in 6.c language, the default default of C<:U>/C<:D> constrained
variables was a type object with such a constraint, which is not initializeable,
thus you cannot use the C<.=> operator, for example.
use v6.c;
my Int:D $x .= new: 42;
# OUTPUT: You cannot create an instance of this type (Int:D)
# in block <unit> at -e line 1
In 6.d language, the default default is the type object without the smiley constraint:
use v6.d.PREVIEW;
my Int:D $x .= new: 42; # OUTPUT: «42␤»
=head3 Constraining signatures of C<Callable>s
The signature of a L<Callable> parameter can be constrained by
Expand Down

0 comments on commit 44ac0f9

Please sign in to comment.