Author: lwall Date: 2009-10-09 02:16:10 +0200 (Fri, 09 Oct 2009) New Revision: 28670
Modified: docs/Perl6/Spec/S12-objects.pod Log: [S12] or there's this approach Modified: docs/Perl6/Spec/S12-objects.pod =================================================================== --- docs/Perl6/Spec/S12-objects.pod 2009-10-08 23:55:31 UTC (rev 28669) +++ docs/Perl6/Spec/S12-objects.pod 2009-10-09 00:16:10 UTC (rev 28670) @@ -1507,12 +1507,24 @@ Int:U Int:_ where !*.defined Int:D Int:_ where *.defined -A bare C<Int> may default differently in different circumstances. -In variable declarations and in invocant declarations, C<:_> is -assumed so that variables can convey undefinedness, whereas in a -formal parameter that is not an invocant, C<:D> is assumed so that -dispatch tends to fail to routines that are expecting defined values. +In standard Perl 6, C<Int> is always assumed to mean C<Int:_>, but +this default may be changed within a lexical scope by various pragmas. +In particular, + use parameters :D; + +will cause non-invocant parameters to default to C<:D>, while + + use invocant :D; + +will do the same for the invocant parameter. In such lexical +scopes you may use the C<:_> form to get back to the standard behavior. +Conjecturally, + + use variables :D; + +would do the same for types used in variable declarations. + =head2 Multiple constraints [Conjecture: This entire section is considered a guess at our