@@ -1962,28 +1962,29 @@ roles, and the enum values are really subset types of C<Int>, though the
1962
1962
constant objects themselves know that they are of type C<Bool> or C<Taint>,
1963
1963
and can therefore be used correctly in multimethod dispatch.
1964
1964
1965
- You can call the low-level C<.truth > coercion on any built-in type, because
1966
- all built-in types do the C<Boolean> role, which requires a C<.truth > method.
1965
+ You can call the low-level C<.Bool > coercion on any built-in type, because
1966
+ all built-in types do the C<Boolean> role, which requires a C<.Bool > method.
1967
1967
Hence, there is a great difference between saying
1968
1968
1969
1969
$x does Boolean; # a no-op, since $x already does Boolean
1970
1970
$x does Bool; # create a $.Bool attribute, also does Boolean
1971
1971
1972
1972
Conditionals evaluate the truth of a boolean expression by testing
1973
- the return value of C<.truth> like this:
1974
-
1975
- $obj.truth != 0
1973
+ the return value of C<.Bool>; how they do this is a mystery, except
1974
+ that they must do something mysterious and platform dependent to
1975
+ avoid calling C<.Bool> recursively on the results of C<.Bool>.
1976
1976
1977
1977
Never compare a value to "C<True>". Just use it
1978
1978
in a boolean context. Well, almost never...
1979
1979
1980
1980
If you wish to be explicit about a boolean context, use the high-level
1981
1981
C<so> function or C<?> prefix operator, which are underlying based
1982
- on the C<.truth> method. Also, use these high level functions when you wish
1983
- to autothread junctions, since C<.truth> forces collapse of a junction's
1984
- wavefunction. (Similarly, C<.gist> forces stringification of the entire
1985
- junction, while prefix:<~> does not.) The C<.Bool> coercion also autothreads
1986
- rather than collapsing.
1982
+ on the C<.Bool> method. Since C<.Bool> always collapses junctions,
1983
+ so do these functions. (Hence if you really need to autothread a
1984
+ bunch of boolean values, you'll have to convert them to some other
1985
+ type such as C<Bit> that can be used as a boolean value later.
1986
+ Generally it makes no sense to autothread booleans, so we have a
1987
+ policy of collapsing them sooner rather than later.)
1987
1988
1988
1989
Like other type names and constant names, enum keynames are parsed as
1989
1990
standalone tokens representing scalar values, and don't look for any
0 commit comments