Constructing an object
Author: Scott Penrose
Problem
You want to create a way for your users to generate new objects
Solution
Merely declare the class. Constructors are provided for you automatically.
Source code: 13-01constructing-an-object.p6
#!/usr/bin/env perl6 use v6; class Foo {} my $foo = Foo.new; say $foo ~~ Foo ?? "Yes" !! "No";