Documentation for infix :=
assembled from the following pages:
Language documentation: Operators §
From Operators
(Operators) infix := §
Binding operator. Whereas $x = $y
puts the value in $y
into $x
, $x := $y
makes $x
and $y
the same thing.
my = 42;my = ;++;say ;
This will output 42, because $a
and $b
both contained the number 42
, but the containers were different.
my = 42;my := ;++;say ;
This will output 43, since $b
and $a
both represented the same object.
If type constrains on variables or containers are present a type check will be performed at runtime. On failure X::TypeCheck::BindingType
will be thrown.
Please note that :=
is a compile time operator. As such it can not be referred to at runtime and thus can't be used as an argument to metaoperators.