2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,16 +1,16 @@
|
|||
class Point {
|
||||
has Num $.x is rw = 0;
|
||||
has Num $.y is rw = 0;
|
||||
has Real $.x is rw = 0;
|
||||
has Real $.y is rw = 0;
|
||||
method Str { $.perl }
|
||||
}
|
||||
|
||||
class Circle {
|
||||
has Point $.p is rw = Point.new;
|
||||
has Num $.r is rw = 0;
|
||||
has Real $.r is rw = 0;
|
||||
method Str { $.perl }
|
||||
}
|
||||
|
||||
my $c = Circle.new(Point.new(x => 1, y => 2), r => 3);
|
||||
my $c = Circle.new(p => Point.new(x => 1, y => 2), r => 3);
|
||||
say $c;
|
||||
$c.p.x = (-10..10).pick;
|
||||
$c.p.y = (-10..10).pick;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue