Help for this page

Select Code to Download


  1. or download this
    sub echo(Int $x) {
        say $x.^name; 
    ...
    --output:--
    Int
    echo() received 3
    
  2. or download this
    
    sub echo(Int $x) {
    ...
    
    --output:--
    Int
    
  3. or download this
    sub echo(Int:D $x) {
        say $x.^name;
    ...
    'Int', not a type object of type 'Int'.  Did you forget a '.new'?
      in sub echo at b.raku line 14
      in block <unit> at b.raku line 18
    
  4. or download this
    sub echo(Int:U $x) {
        say $x.^name;
    ...
    not an object instance of type 'Int'.  Did you forget a 'multi'?
      in sub echo at b.raku line 14
      in block <unit> at b.raku line 22
    
  5. or download this
    multi sub echo(Int:U $x) {
        say $x.^name;
    ...
    }
    
    echo(3);
    
  6. or download this
    sub echo(Int:D: $x) {
        say $x.^name;
    ...
    ------> sub echo(Int:D: $x&#9167;) {
        expecting any of:
            constraint
    
  7. or download this
    class Dog {
        has Str $.name;
    ...
    bark
    bark
    bark
    
  8. or download this
    class Dog {
        has Str $.name;
    ...
    bark
    bark
    bark
    
  9. or download this
    class Dog {
        has Str $.name;
    ...
            say "bark" for 1..$x;       
        }
    }
    
  10. or download this
    class Dog {
        has Str $.name;
    ...
    
    my $d = Dog.new(name => "Rover");
    $d.bark(3);
    
  11. or download this
    class Dog {
        has Str $.name;
    ...
    a type object of type 'Dog'.  Did you forget a '.new'?
      in method bark at b.raku line 30
      in block <unit> at b.raku line 36
    
  12. or download this
    class Dog {
        has Str $.name;
    ...
    bark
    bark
    bark
    
  13. or download this
    class Dog {
        has Str $.name;
    ...
      in method bark at b.raku line 30
      in block <unit> at b.raku line 39
    
  14. or download this
    routine chr
    
    multi sub    chr(Int:D  --> Str:D)
    multi method chr(Int:D: --> Str:D)
    
  15. or download this
    32] > chr(99);
    c
    
  16. or download this
    [33] > 99.chr
    c
    
  17. or download this
    my method m(Int:D: $b){
        say self.^name
    ...
    my $i = 1;
    $i.&m(<a>);
    # OUTPUT: «Int»