Declaring subroutines in NQP
Standard declaration:
sub hello($x) {
say('Hello, ', $x);
}
Optional parameters:
sub f1($x, $y!, $z?) { ... }
Named parameters:
sub f1($x, :$y) { ... }
| Parrot | NQP, grammars, and actions | #10 |
Standard declaration:
sub hello($x) {
say('Hello, ', $x);
}
Optional parameters:
sub f1($x, $y!, $z?) { ... }
Named parameters:
sub f1($x, :$y) { ... }
|
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |