Changeset 22904 for docs

Show
Ignore:
Timestamp:
11/06/08 23:18:15 (2 months ago)
Author:
masak
Message:

[Spec/Functions.pod] added .fmt

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Spec/Functions.pod

    r22606 r22904  
    14331433 sprintf "%ld a big number, %lld a bigger number, %mf complexity\n", 
    14341434        4294967295, 4294967296, 1+2i); 
     1435 
     1436=item fmt 
     1437 
     1438  our Str multi method fmt( Scalar $scalar: ) 
     1439  our Str multi method fmt( List $list:, Str $separator ) 
     1440  our Str multi method fmt( Hash $hash:, Str $separator ) 
     1441  our Str multi method fmt( Pair $pair: ) 
     1442 
     1443A wrapper on C<sprintf>. A call to the scalar version C<$o.fmt($format)> 
     1444returns the result of C<sprintf($format, $o)>. A call to the array version 
     1445C<@a.fmt($format, $sep)> returns the result of C<join $sep, map { 
     1446sprintf($format, $_) }, @a>. A call to the hash version C<%h.fmt($format, 
     1447$sep)> returns the result of C<join $sep, map { sprintf($format, $_.key, 
     1448$_.value) }, %h.pairs>. A call to the pair versionC<%p.fmt($format)> returns 
     1449the result of C<sprintf($format, %h.key, 
     1450%h.value)>. 
    14351451 
    14361452=item substr