Skip to content

Instantly share code, notes, and snippets.

@CurtTilmes
Created December 3, 2017 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CurtTilmes/3e7b3ed21b6a88e1f70e1b0828757f0e to your computer and use it in GitHub Desktop.
Save CurtTilmes/3e7b3ed21b6a88e1f70e1b0828757f0e to your computer and use it in GitHub Desktop.
class Book {
has $.title;
has $.author;
has $.count;
has @.tags;
}
my @booklist =
Book.new(title => 'A Christmas Carol',
author => 'Charles Dickens',
count => 12,
tags => <ghost christmas>),
Book.new(title => 'A Visit from St. Nicholas',
author => 'Clement Clarke Moore',
count => 4,
tags => <santa christmas>);
for @booklist -> Book $b (:$title,:$author, :$count, :@tags) {
say "$title, $author, $count, @tags[]";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment