Perl 6 Perl 6 Lists, Arrays, and Hashes vivified #49

Positional role

The Positional role reflects objects that support indexing

Variables using the @ sigil only bind to Positional arguments

List , Array , and Parcel implement Positional
sub shout-them(@words) {
    for @words { print uc($w), " " }
}

my @lastwords = <Perl 6 rocks>;
shout-them(@lastwords);          # PERL 6 ROCKS
shout-them('no', 'way');         # error, too many arguments
shout-them(   'no'  );           # error, Str not positional
shout-them( @('no') );           # ok with list contextualizer
Copyright © 2011
http://www.pmichaud.com/2011/pres/