raku-type-x-bind-slice
class X::Bind::Slice is Exception {}
배열이나 해시 슬라이스에 바인딩하려고 하면 던져지는 예외예요.
my @a; @a[0, 1] := [42];
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Bind::Slice: Cannot bind to Array slice»
그리고
my %h; %h<a b> := {};
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Bind::Slice: Cannot bind to Hash slice»
이 두 경우 모두 X::Bind::Slice 타입의 예외가 나와요.
Methods
method type
method type(X::Bind::Slice:D:)
슬라이스 바인딩을 시도한 대상의 타입 객체를 돌려줘요. 예를 들면 Array, List, Hash 같은 거죠.