use Window;
window C {
method bla is external {
say "bla"
}
}
C.new.bla
class WindowHOW is Metamodel::ClassHOW {
method add_method(Mu $type, $name, $meth) {
self.Metamodel::ClassHOW::add_method:
$type,
$name,
$meth.?is-external
?? my method { say "called $name and something different happened" }
!! $meth
}
}
role External {
method is-external { True }
}
multi trait_mod:<is>(Method $m, :$external) is export {
$m does External
}
my package EXPORTHOW {
package DECLARE {
constant window = WindowHOW;
}
}