Help for this page

Select Code to Download


  1. or download this
    use v6.d;
    
    ...
    Constraint type check failed in binding to parameter '$x'; expected an
    +onymous constraint to be met but got Int (0)
      in sub go at b.raku line 4
      in block <unit> at b.raku line 9
    
  2. or download this
    sub go(Int $x where 1 < * < 9) {
        say $x;
    ...
    Constraint type check failed in binding to parameter '$x'; expected an
    +onymous constraint to be met but got Int (0)
      in sub go at b.raku line 4
      in block <unit> at b.raku line 9
    
  3. or download this
    for <a b c> {say $_};  # shorter version: for <a b c> {.say}
    for <a b c> {say *};
    ...
    *
    *
    *
    
  4. or download this
    sub MAIN(
      Str   $file where *.IO.f = 'file.dat',
    ...
        say $file   if $file.defined;
        say 'Verbosity ', ($verbose ?? 'on' !! 'off');
    }
    
  5. or download this
    class Foo {
        method bar( $self: ){ "baz" }
    };
    say Foo.^methods.first(*.name eq 'bar').signature ~~ :($: *%) ;
    # OUTPUT: «True&#9252;»