=-------------------------------------------------
=section assignment vs binding 
=-------------------------------------------------

* A =  B ; 
  "assign" means : 
          evaluate the *value* on the right hand side and
          *distribute* it ( value ) among the containers ( which if
          needed should be created/changed ) on the left .

* A := B ; 
   *alias* or *bind* variable containers to names : 
          take a hold of containers on the right hand side and
          *distribute* them (containers ) among ( bind them to )
          *names* on the left.

there is a special binding operator ::= that is same as := but force
binding to happen at compile time . 

so , again , 

* after the assignment ( variables at ) left and right hand sides
  refer to the same values through different ( independent )
  containers.  ( modulo some Copy on Write magic ) . 
  
$a = $b ;
($a, $b) = ($b, $a); 
(@a, @b) = (@b, @a); 
@a = ( @b, @c ) ; 
&a = sub { ... } ; 

* after the binding -- ( names, if there were names !  ) at right hand
  side and names ( which surely have to be there ! ) at left hand
  sides refer to the same containers.

$a := $b ;
($a, $b) := ($b, $a); 
(@a, @b) := (@b, @a); 
@a := ( @b, @c ) ; 
&a := sub { ... } ; #same as sub a { ... } 


#here @a *interface* can change values seen by $x, $y, $z, @c 
@a := ( $x , $y, $z , @c) ;

#here first *anonymous container is created holding (1, 2, 3) and then
#this container is bound to name '@a'
@b := ( 1 ,2 ,3 ) ;


as a consequence, run-time properties are "passed" ( from the variable
on the right side to variables on the left ) in both cases , since
they are attached to values . compile-time properties are "passed"
only at binding since they are attached to containers .


Reply via email to