While the first one is (I hope) self-explanatory, the second one requires some explanation. All the lines in it are has-a relationships; Pad has-a Scalar Container that you can look up with $name:
my $name;
The Container either has-a mutable cell, or has-a constant cell:
my $mut = 3;
my $con:= 3;
Use
my $x = 3;
my $y = 4;
my $z = 5;
$x:= $y; # $x and $y now contain the same cell
$x:= $z; # not anymore; $x now shares the cell with $z
Each cell has-a Id. Use =:= to check whether two containers have cells of the same Id:
$x =:= $y; # false
$x =:= $z; # true
Mutable cells has-a mutable scalar value. Use = to change its value:
$mut = 5; # works
Constant cells has-a immutable scalar value. You cannot change it:
$con = 6; # error
Each cell is declared to be is Tieable or not tieable when it was allocated; you cannot change tieableness at runtime.
my $nvar;
my $tvar is Tieable;
Tieable cells may be tied or untied. Use tie to tie a tieable cell:
tie($tvar, SomeClass, some_param => 1);
Non-tieable cells may not be tied. However, untie always works:
untie($tvar); # works
untie($nvar); # no-op
That's about it for today. I hope you enjoy the pictures.
Pictures (Score:2)
Re:Pictures (Score:2)
Re:Pictures (Score:2)