Help for this page

Select Code to Download


  1. or download this
    method set( :$x = $.x, :$y = $.y )
    
  2. or download this
    Named parameters
    
    ...
    
    It is an error to pass the arguments as if they were positional.
    For example, a call distance(30, 10) generates an error: ...
    
  3. or download this
    class Rectangle {
        has Int $.length = 1;
    ...
     
    my $r1 = Rectangle.new(length => 2, width => 3);
    say $r1.area();
    
  4. or download this
    has Bool $.done;
    
  5. or download this
    has Bool $!done;
    method done() { return $!done }
    
  6. or download this
    use v6;
    
    ...
    $point.set(joe => 100);
    say $point;  # [100, 20]