/
experimental.pod6
48 lines (32 loc) · 1.81 KB
/
experimental.pod6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
=begin pod :tag<perl6>
=TITLE Experimental Features
=SUBTITLE New features for brave users
During Perl 6 development, new features are often made available for
users to experimental with before their design is completed. Eventually
these features may be made part of the Perl 6 specification. To use these
features, one uses the C<experimental> pragma in program source code, for
example, like this:
use experimental :macros;
Following is a list of current experimental features and a short
description of each feature's purpose or a link to more details about
its use. (Note: Features marked "[TBD]" are to be defined
later.)
=comment The following should be a table but formatting in tables is
not yet rendered properly.
=item X<B<cache>|cache> [TBD]
=item X<B<macros>|macros> [TBD]
=item X<B<pack>|pack> [TBD]
=head1 Collation
The L<collate> and L<coll> methods are no longer experimental. However,
they are affected by the X<B<$*COLLATION>|$*COLLATION>, which configures the four X<collation levels>. While the Primary, Secondary and Tertiary mean different things for different scripts, for the Latin script used in English they mostly correspond with Primary being Alphabetic, Secondary being Diacritics and Tertiary being Case.
In the example below you can see how when we disable tertiary collation which in
Latin script generally is for case, and also disable quaternary which breaks
any ties by checking the codepoint values of the strings, we get B<Same> back
for B<A> and B<a>:
use experimental :collation;
$*COLLATION.set(:quaternary(False), :tertiary(False));
say 'a' coll 'A'; #OUTPUT: «Same»
say ('a','A').collate == ('A','a').collate; # OUTPUT: «True»
The $*COLLATION API could change at any time, so use it with caution.
=end pod
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6