Skip to content

Commit d1e147e

Browse files
committed
Some revision, also #2725, #2483
1 parent 3e3ee41 commit d1e147e

File tree

2 files changed

+21
-40
lines changed

2 files changed

+21
-40
lines changed

doc/Language/5to6-perlvar.pod6

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -577,54 +577,32 @@ therefore, as stated before, the C<$!> variable holds the exception object.
577577
578578
=head2 Variables related to the interpreter state
579579
580-
=item $COMPILING
581-
582-
=item $^C
583-
584-
=item $^D
585-
586-
=item ${^ENCODING}
587-
588-
=item ${^GLOBAL_PHASE}
580+
=head3 $COMPILING, $^C, $^D, ${^ENCODING}, ${^GLOBAL_PHASE}
589581
590582
Currently no equivalents for either of these variables.
591583
592-
=item $^H
593-
594-
=item %^H
595-
596-
=item ${^OPEN}
584+
=head3 $^H, %^H, ${^OPEN}
597585
598586
There may or may not be equivalents of these in Perl 6, but they're internal
599587
and you shouldn't be messing with them in the first place - certainly not if
600588
your understanding of Perl 6 requires you to read this document...
601589
602-
=item $PERLDB
603-
604-
=item $^P
590+
=head3 $PERLDB, $^P
605591
606592
The chance of the Perl 6 debugger resembling the Perl 5 debugger is slim
607593
at best, and at this point there does not seem to be an equivalent of
608594
this variable.
609595
610-
=item ${^TAINT}
596+
=head3 ${^TAINT}
611597
612598
S28 claims this variable is "pending". Not currently in Perl 6.
613599
614-
=item ${^UNICODE}
615-
616-
=item ${^UTF8CACHE}
617-
618-
=item ${^UTF8LOCALE}
600+
=head3 ${^UNICODE}, ${^UTF8CACHE}, ${^UTF8LOCALE}
619601
620602
These Unicode-related variables do not appear to exist in Perl 6, but -
621603
maybe? - could have analogs in C<$?ENC> somewhere. This, however, is
622604
totally unconfirmed.
623605
624-
=head2 Deprecated and removed variables
625-
626-
It should go without saying that, as these have been removed from Perl 5
627-
already, there should be no need to tell you how to use them in Perl 6.
628606
629607
=end pod
630608

doc/Language/contexts.pod6

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@
66
77
A context is needed, in many occasions, to interpret the value of a container.
88
In Perl 6, we will use context to coerce the value of a container into some type
9-
or class, or decide what to do with it, as in the case of the sink context.
9+
or class, or in general decide what to do with it, as in the case of the sink
10+
context.
1011
1112
=head1 Sink X<|sink context>
1213
13-
I<Sink> is equivalent to C<void> context, that is, a context in which we throw
14-
(down the sink, as it were) the result of an operation or the return value from
15-
a block. In general, this context will be invoked in warnings and errors when a
16-
statement does not know what to do with that value.
14+
The I<sink> context is equivalent to what in other languages is called C<void>
15+
context, that is, a context in which we throw (down the sink, as it were) the
16+
result of an operation or the return value from a block. In general, this
17+
context will be invoked in warnings and errors when a statement does not know
18+
what to do with that value.
1719
1820
=begin code
1921
my $sub = -> $a { return $a² };
2022
$sub; # OUTPUT: «WARNINGS:␤Useless use of $sub in sink context (line 1)␤»
2123
=end code
2224
23-
X<|sinking> You can force that sink context on L<Iterator|/type/Iterator>s, by
25+
X<|sinking>
26+
You can force that sink context on L<Iterator|/type/Iterator>s, by
2427
using the L<C<sink-all>|/routine/sink-all> method. L<Proc|/type/Proc>s can also
2528
be L<sunk via the C<sink> method|/type/Proc#method_sink>, forcing them to raise
2629
an exception and not returning anything.
@@ -39,17 +42,16 @@ sub foo {
3942
method sink { say "sink called" }
4043
}
4144
}
42-
foo
43-
# OUTPUT: sink called
45+
foo; # OUTPUT: sink called
4446
=end code
4547
4648
4749
=head1 Number X<|number context>
4850
49-
This context, and probably all of them except sink above, are I<conversion> or
50-
I<interpretation> contexts in the sense that they take an untyped or typed
51-
variable and duck-type it to whatever is needed to perform the operation. In
52-
some cases that will imply a conversion (from L<Str|/type/Str> to
51+
This context, and probably all other contexts except I<sink> above, are
52+
I<conversion> or I<interpretation> contexts in the sense that they take an
53+
untyped or typed variable and duck-type it to whatever is needed to perform the
54+
operation. In some cases that will imply a conversion (from L<Str|/type/Str> to
5355
L<Numeric|/type/Numeric>, for instance); in other cases simply an interpretation
5456
(L<IntStr|/type/IntStr> will be interpreted as L<Int|/type/Int> or as
5557
L<Str|/type/Str>).
@@ -82,7 +84,8 @@ say True+$list; # OUTPUT: «4␤»
8284
=end code
8385
8486
In the case of I<listy> things, the numeric value will be in general equivalent
85-
to C<.elems>; in some cases, like L<Thread|/routine/Numeric#(Thread)_method_Numeric> it
87+
to C<.elems>; in some cases, like
88+
L<Thread|/routine/Numeric#(Thread)_method_Numeric> it
8689
will return an unique thread identifier.
8790
8891
=head1 String X<|string context>

0 commit comments

Comments
 (0)