Parrot Parrot Compiler Toolkit #59

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) { ... }
Copyright © 2009
http://www.pmichaud.com/2009/pres/