Changeset 9963 for docs/Perl6/FAQ
- Timestamp:
- 04/16/06 07:22:18 (3 years ago)
- Files:
-
- 1 modified
-
docs/Perl6/FAQ/Capture.pod (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/Perl6/FAQ/Capture.pod
r9962 r9963 42 42 sub make_car ( 43 43 Str $model, 44 Str $color = "black",45 Int $doors = 444 Str $color? = "black", 45 Int $doors = 4 46 46 ) { ... } 47 47 … … 114 114 Let's look at some examples: 115 115 116 sub make_car (Int $doors) { say "My car has $doors doors" } 117 make_car( doors => 2, doors => 4 ); # 4 doors 116 sub make_car (Int $doors) { 117 say "My car has $doors doors"; 118 } 119 make_car( 120 doors => 2, doors => 4 121 ); # 4 doors 118 122 119 sub board_ark (@animal) { say "@animal.elems() animals boarded the ark" } 120 board_ark( animal => "moose", animal => "elephant"); # 2 animals 123 sub board_ark (@animal) { 124 say "@animal.elems() animals boarded the ark"; 125 } 126 board_ark( 127 animal => "moose", animal => "elephant" 128 ); # 2 animals 121 129 122 130 A Capture object may hold named arguments that occur twice or more.
