Mercurial > hg > Others > Rakudo
diff src/core.c/Whatever.pm6 @ 0:c341f82e7ad7 default tip
Rakudo branch in cr.ie.u-ryukyu.ac.jp
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 26 Dec 2019 16:50:27 +0900 (2019-12-26) |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/core.c/Whatever.pm6 Thu Dec 26 16:50:27 2019 +0900 @@ -0,0 +1,20 @@ +my class X::Cannot::Capture { ... } +my class X::Cannot::New { ... } + +my class Whatever { + multi method ACCEPTS(Whatever:D: Mu --> True) { } + multi method perl(Whatever:D: --> '*') { } + multi method Str(Whatever:D: --> '*') { } + method Capture() { X::Cannot::Capture.new( :what(self) ).throw } +} + +my class HyperWhatever { + multi method new(HyperWhatever:) { X::Cannot::New.new(class => self).throw } + multi method ACCEPTS(HyperWhatever:D: $ --> True) { } + multi method perl(HyperWhatever:D:) { '**' } + method Capture() { X::Cannot::Capture.new( :what(self) ).throw } +} + +sub HYPERWHATEVER (&c) { sub (*@_) { map &c, @_ } } + +# vim: ft=perl6 expandtab sw=4