In this book I use my "PEGS" ( PErl Graphical Structures) notation to illustrate data structures. It should be mostly self-explanatory, but here is a brief overview. Scalar values are represented with a single rectangular box:
Variables are values with names. Names go in a sideways "picket" above the value. Boxes can be adorned with the internal Perl type [3] and with the access syntax for the value:
Arrays and lists have the same graphical representation. They look like a stack of values with a thick bar on top:
Hashes look like a stack of names next to a stack of values:
References are drawn with dots and arrows like those LISP diagrams from days of yore:
That's all there is to the basics. PEGS is really not very complicated, but if you want to know more, you can take a look at the official PEGS web page, located at http://www.effectiveperl.com/pegs/. |