class NFC

Codepoint string in Normal Form C (composed)

class NFC is Uni {}

A Codepoint string in Unicode Normalization Form C. It is created by Canonical Decomposition, followed by Canonical Composition. For more information on what this means, see Unicode TR15.

Type Graph

Type relations for NFC
perl6-type-graph NFC NFC Uni Uni NFC->Uni Mu Mu Any Any Any->Mu Positional Positional Stringy Stringy Uni->Any Uni->Positional Uni->Stringy

Expand above chart

Routines supplied by class Uni

NFC inherits from class Uni, which provides the following routines:

(Uni) method new

method new(*@codes --> Uni:D)

Creates a new Uni instance from the given codepoint numbers.

(Uni) method list

Defined as:

method list(Uni:D:)

Returns a Seq of integer codepoints.

(Uni) method NFC

method NFC(Uni:D: --> NFC:D)

Returns a NFC (Normal Form Composed)-converted version of the invocant.

(Uni) method NFD

method NFD(Uni:D: --> NFD:D)

Returns a NFD (Normal Form Decomposed)-converted version of the invocant.

(Uni) method NFKC

method NFKC(Uni:D: --> NFKC:D)

Returns a NFKC (Normal Form Compatibility Composed)-converted version of the invocant.

(Uni) method NFKD

method NFKD(Uni:D: --> NFKD:D)

Returns a NFKD (Normal Form Compatibility Decomposed)-converted version of the invocant.

(Uni) method codes

method codes(Uni:D: --> Int:D)

Returns the number of codepoints in the invocant.

(Uni) method elems

method elems(Uni:D: --> Int:D)

Returns the number of codepoints in the invocant.

Routines supplied by role Positional

NFC inherits from class Uni, which does role Positional, which provides the following routines:

(Positional) method of

method of()

Returns the type constraint for elements of the positional container, that is, the T in the definition above, which, as it can be seen, defaults to Mu. It is returned as a type object.

my @þ;
say @þ.of.^name;   # OUTPUT: «Mu␤ 
my Str @þð;
say @þð.of.raku;   # OUTPUT: «Str␤» 
say (my int @).of# OUTPUT: «(int)␤» 

(Positional) method elems

method elems()

Should return the number of available elements in the instantiated object.

(Positional) method AT-POS

method AT-POS(\position)

Should return the value / container at the given position.

(Positional) method EXISTS-POS

method EXISTS-POS(\position)

Should return a Bool indicating whether the given position actually has a value.

(Positional) method STORE

method STORE(\values:$INITIALIZE)

This method should only be supplied if you want to support the:

my @a is Foo = 1,2,3;

syntax for binding your implementation of the Positional role.

Should accept the values to (re-)initialize the object with. The optional named parameter will contain a True value when the method is called on the object for the first time. Should return the invocant.