Author: lwall Date: 2009-11-11 18:18:19 +0100 (Wed, 11 Nov 2009) New Revision: 29056
Modified: docs/Perl6/Spec/S04-control.pod Log: [S04] clarify Nil semantics of empty blocks and missing branches, pmurias++ Modified: docs/Perl6/Spec/S04-control.pod =================================================================== --- docs/Perl6/Spec/S04-control.pod 2009-11-11 17:13:35 UTC (rev 29055) +++ docs/Perl6/Spec/S04-control.pod 2009-11-11 17:18:19 UTC (rev 29056) @@ -195,10 +195,10 @@ =head1 The Relationship of Blocks and Statements The return value of a block is the value of its final statement. -The value of an empty block is C<Nil>. (This is subtly different from PerlĀ 5's behavior, which was to return the value of the last expression evaluated, even if that expression -was just a conditional.) +was just a conditional.) If there are no statements in the block, +the result is C<Nil>. =head1 Statement-ending blocks @@ -264,7 +264,8 @@ ... } -If the final statement is a conditional which does not execute any +The result of a conditional statement is the result of the block +chosen to execute. If the conditional does not execute any branch, the return value is C<Nil>. The C<unless> statement does not allow an C<elsif> or C<else> in PerlĀ 6.