Created
December 3, 2017 18:16
-
-
Save CurtTilmes/3e7b3ed21b6a88e1f70e1b0828757f0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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