Changeset 22905 for docs

Show
Ignore:
Timestamp:
11/07/08 00:04:15 (2 months ago)
Author:
masak
Message:

[Spec/Functions.pod] various changes to .fmt commit:
* C<> no longer line-broken
* fixed some %p and %h which should be $p
* added defaults for the $separator param in the List and Hash versions

Files:
1 modified

Legend:

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

    r22904 r22905  
    14371437 
    14381438  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 ) 
     1439  our Str multi method fmt( List $list:, Str $separator = ',' ) 
     1440  our Str multi method fmt( Hash $hash:, Str $separator = "\n" ) 
    14411441  our Str multi method fmt( Pair $pair: ) 
    14421442 
    1443 A wrapper on C<sprintf>. A call to the scalar version C<$o.fmt($format)> 
    1444 returns the result of C<sprintf($format, $o)>. A call to the array version 
    1445 C<@a.fmt($format, $sep)> returns the result of C<join $sep, map { 
    1446 sprintf($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 
    1449 the result of C<sprintf($format, %h.key, 
    1450 %h.value)>. 
     1443A set of wrappers around C<sprintf>. A call to the scalar version 
     1444C<$o.fmt($format)> returns the result of C<sprintf($format, $o)>. A call to 
     1445the array version C<@a.fmt($format, $sep)> returns the result of 
     1446C<join $sep, map { sprintf($format, $_) }, @a>. A call to the hash version 
     1447C<%h.fmt($format, $sep)> returns the result of 
     1448C<join $sep, map { sprintf($format, $_.key, $_.value) }, %h.pairs>. A call 
     1449to the pair versionC<$p.fmt($format)> returns the result of 
     1450C<sprintf($format, $p.key, $p.value)>. 
    14511451 
    14521452=item substr