Author: lwall Date: 2009-12-18 05:28:09 +0100 (Fri, 18 Dec 2009) New Revision: 29366
Modified: docs/Perl6/Spec/S03-operators.pod docs/Perl6/Spec/S12-objects.pod docs/Perl6/Spec/S32-setting-library/Basics.pod Log: [S03] rename prefix:<true> to prefix:<so> to avoid having to explain the valence difference between 'true' and 'True', and to make truth slightly shorter than falsity in a huffmanly sort of way. Modified: docs/Perl6/Spec/S03-operators.pod =================================================================== --- docs/Perl6/Spec/S03-operators.pod 2009-12-18 04:05:15 UTC (rev 29365) +++ docs/Perl6/Spec/S03-operators.pod 2009-12-18 04:28:09 UTC (rev 29366) @@ -16,7 +16,7 @@ Created: 8 Mar 2004 Last Modified: 17 Dec 2009 - Version: 182 + Version: 183 =head1 Overview @@ -49,7 +49,7 @@ X Tight or || ^^ // min max R Conditional ?? !! ff fff R Item assignment = := ::= => += -= **= xx= .= - L Loose unary true not + L Loose unary so not X Comma operator , p5=> : X List infix Z minmax X X~ X* Xeqv ... R List prefix print push say die map substr ... [+] [*] any $ @ @@ -593,7 +593,7 @@ Evaluates the expression as a boolean and returns C<True> if expression is true or C<False> otherwise. -See "true" below for a low-precedence alternative. +See "so" below for a low-precedence alternative. =item * @@ -1522,16 +1522,26 @@ =item * -C<< prefix:<true> >> +C<< prefix:<not> >> - true any(@args) eq '-v' | '-V' + not any(@args) eq '-v' | '-V' +Returns a C<Bool> value representing the logical negation of an expression. + =item * -C<< prefix:<not> >> +C<< prefix:<so> >> - not any(@args) eq '-v' | '-V' + so any(@args) eq '-v' | '-V' +Returns a C<Bool> value representing the logical non-negation of an expression. +Mostly useful as documentation in parallel to a C<not> when C<else> isn't +appropriate: + + if not $x { print "LOL"; } + mumble(); + if so $x { print "SRSLY!" } + =back =head2 Comma operator precedence @@ -2895,8 +2905,10 @@ behavior is not desired, put the expression into item context rather than list context.) This self-deletion is a behavior of the operators themselves, not a general property of boolean values in list context, so +either of: - @foo = true($a||$b); + @foo = so($a||$b); + @foo = not($a||$b); is guaranteed to insert exactly one boolean value into C<@foo>. Modified: docs/Perl6/Spec/S12-objects.pod =================================================================== --- docs/Perl6/Spec/S12-objects.pod 2009-12-18 04:05:15 UTC (rev 29365) +++ docs/Perl6/Spec/S12-objects.pod 2009-12-18 04:28:09 UTC (rev 29366) @@ -1789,9 +1789,7 @@ compilation error. (All colliding values are hidden, not just the new one, or the old one.) Any explicit sub or type definition hides all imported enum keys of the same name but will produce a warning unless -C<is redefined> is included. Note that true() is a built-in function -and requires an argument, while C<True> is short for C<Bool::True> and -does not take an argument. +C<is redefined> is included. Since non-native C<Enum> values know their enumeration type, they may be used to name a desired property on the right side of a C<but> or C<does>. Modified: docs/Perl6/Spec/S32-setting-library/Basics.pod =================================================================== --- docs/Perl6/Spec/S32-setting-library/Basics.pod 2009-12-18 04:05:15 UTC (rev 29365) +++ docs/Perl6/Spec/S32-setting-library/Basics.pod 2009-12-18 04:28:09 UTC (rev 29366) @@ -44,7 +44,7 @@ our multi method undefine( $self: ) is export {...} method not() {...} - method true() {...} + method so() {...} } =over @@ -86,9 +86,9 @@ method not() {...} -=item true +=item so - method true() {...} + method so() {...} XXX Copied from S02 -- should it be deleted from there?