TITLE ^

Str - Perl 6 Str class and related functions

DESCRIPTION ^

This file sets up the Perl6Str PMC type (from src/pmc/perl6str.pmc) as the Perl 6 Str class.

Methods ^

perl()

Returns a Perl representation of the Str.

sprintf( *@args )

WHICH()

Returns the identify value.

Functions ^

infix:===

Overridden for Str.

TODO Functions ^

p5chop

 our Char multi P5emul::Str::p5chop ( Str  $string is rw )
 our Char multi P5emul::Str::p5chop ( Str *@strings = ($+_) is rw )
Trims the last character from $string, and returns it. Called with a list, it chops each item in turn, and returns the last character chopped.

p5chomp

 our Int multi P5emul::Str::p5chomp ( Str  $string is rw )
 our Int multi P5emul::Str::p5chomp ( Str *@strings = ($+_) is rw )
Related to p5chop, only removes trailing chars that match /\n/. In either case, it returns the number of chars removed.

chomp

 our Str method Str::chomp ( Str $string: )
Returns string with newline removed from the end. An arbitrary terminator can be removed if the input filehandle has marked the string for where the "newline" begins. (Presumably this is stored as a property of the string.) Otherwise a standard newline is removed.

Note: Most users should just let their I/O handles autochomp instead. (Autochomping is the default.)

length

This word is banned in Perl 6. You must specify units.

index

Needs to be in terms of StrPos, not Int.

pack

pos

quotemeta

rindex

Needs to be in terms of StrPos, not Int.

sprintf

unpack

vec

Should replace vec with declared arrays of bit, uint2, uint4, etc.

words

 our List multi Str::words ( Rule $matcher = /\S+/,  Str $input = $+_, Int $limit = inf )
 our List multi Str::words ( Str $input : Rule $matcher = /\S+/, Int $limit = inf )


parrot