class X::Bind::Slice

Error due to binding to a slice
class X::Bind::Slice is Exception {}

When you try to bind to an array or hash slice:

my @a; @a[0, 1] := [42];
    CATCH { default { put .^name, ': ', .Str } };
    # OUTPUT: «X::Bind::Slice: Cannot bind to Array slice␤»

and

my %h; %h<a b> := {};
    CATCH { default { put .^name, ': ', .Str } };
    # OUTPUT: «X::Bind::Slice: Cannot bind to Hash slice␤»

you get an exception of type ::Bind::Slice.

Methods

method type

method type(X::Bind::Slice:D:)

returns the type object of the thing that you tried to slice-bind, for example Array, List or Hash.

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.