Day 180 (r6092): Pretty pictures!

autrijus on 2005-08-06T17:49:17

As I'm moving forward with the new PIL runcore, I'm now trying to document my understanding as visual diagrams. Today I produced two:

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 := to change the cell inside a container:

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

malte on 2005-08-07T10:53:53

The pictures are really great! What program did you use to make them?

Re:Pictures

autrijus on 2005-08-07T16:03:55

Visio, with the excellent Nuvola icon set. Previously I've produced SVK at a glance with the same set of tools.

Re:Pictures

malte on 2005-08-08T06:32:59

Damn, Visio. I hoped I missed the announcement of Apple's new easy to use graphics tool for superior looking pictures :)