#!/usr/bin/perl6

BEGIN {
  if $*PERL.version before Version.new('6.c') {
    my $first-release-date = Date.new: 2015,12,25;
    say "This version of the compiler $*PERL.compiler.version()";
    say "is from before the official release of Perl 6 on $first-release-date.";
    
    say '';
    
    my $compiler = $*PERL.compiler;
    my ($year,$month) = $compiler.version.parts[0,1];
    my $this-compiler-date = Date.new( :$year, :$month );
    say "In fact it could be from { $first-release-date - $this-compiler-date } days before that.";
    my $build-date = $compiler.build-date.Date;
    say "It was built on $build-date, which is still { $first-release-date - $build-date } days before the release.";
    
    say '';
    say 'refusing to run';
    exit 1;
  }
}

say {[X] $^a xx$^b}( (0,1), 2 );
say {[X] $^a xx$^b}( (1,0), 2 );
say {[X] $^a xx$^b}( (0,1,2), 2 );

say {[X] $^a xx$^b}( (0,1), 5 );