perl6/doc/lib/X/Bind/NativeType

doc src
(title) class X::Bind::NativeType
    class X::Bind::NativeType does X::Comp { }

 
Compile-time error thrown when trying to bind to a natively typed variable. Since native variables explicitly don't have the concept of a container at run time. Thus it does not make sense to support both binding and assignment, and Perl 6 supports only assignment (which makes more sense, because native types are value types). So use assignment for natively typed variables. For example the code
    my int $x := 3;

 
dies with
    Cannot bind to natively typed variable '$x'; use assignment instead

 
and can be fixed by writing it as
    my int $x = 3;

 

Methods

(head2) name
    method name() returns Str:D

 
Returns the name of the variable.

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: