use strict; use warnings; use lib './lib'; use Test::More; use Data::Dumper; use Blacknote::Interface; use Blacknote::System; use Blacknote::Input; my $interf = definterface(IMyInterface => qw(one two three four)); my $impl = defimpl IMyInterface => MyClass => 1, one => sub{print "one\n"}, two => sub {print "two\n"}, four => sub {print "four\n"}, three => sub {}; defclass Newclass => methods => {func1 => sub {}}; defclass ABC => methods => {func2=>sub{}}; my $newclass = Newclass->new; isa_ok $newclass, "main::Newclass"; defrole RPrint => methods => { simple_print => sub { print "Simple\n" } }; fulfill 'main::RPrint' => qw(main::Newclass main::ABC); my $obj = MyClass->new; isa_ok $obj, "main::MyClass"; ok not $obj->meta->is_immutable; ok not $obj->isa("main::RPrint"); can_ok "ABC", "simple_print"; dyn_fulfill 'main::RPrint' => $obj; ok $obj->isa("RPrint"); isa_ok $obj, "main::RPrint"; finalize; ok $obj->meta->is_immutable; can_ok $obj, qw(new one two three four simple_print); note explain $obj; ok implements($obj, "main::IMyInterface"); my $metak = defkeymap(BaseMovement => h => 'move_w', j => 'move_n', k => 'move_s', l => 'move_e'); print BaseMovement->keyfunc_h . "\n"; done_testing; .