File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ the return value:
320
320
Python 2 functions can be called with positional arguments
321
321
or keyword arguments. These are determined by the caller.
322
322
In Python 3, some arguments may be "keyword only".
323
- IN Perl 6 positional and named arguments are determined
323
+ In Perl 6, positional and named arguments are determined
324
324
by the signature of the routine.
325
325
326
326
Python
@@ -345,6 +345,7 @@ Named parameters start with a colon:
345
345
say $word for ^$times
346
346
}
347
347
speak(word => 'hi',times => 2);
348
+ speak(:word<hi>, :times<2>); # Alternative, more idiomatic
348
349
349
350
Perl 6 supports multiple dispatch, so several signatures
350
351
could be made available by declaring a routine as a C < multi > .
@@ -356,7 +357,7 @@ could be made available by declaring a routine as a C<multi>.
356
357
speak($word,$times);
357
358
}
358
359
speak('hi', 2);
359
- speak(word => 'hi',times => 2 );
360
+ speak(: word<hi>, :times<2> );
360
361
361
362
Named parameters can be sent using a variety of formats:
362
363
You can’t perform that action at this time.
0 commit comments