11.1 Object-oriented programming

This Mathematica notebook supports the corresponding section of M&M.  It's intended to be executed in sequence.  It may include some tests not shown in the book.  It contains code for exercise solutions, but usually little discussion of them.  The version distributed with the book will contain solutions only for odd-numbered exercises.
	Any  Export  commands that produced figures for the book are commented out, so that they won't reference nonexistent folders.  They always duplicate figures rendered just previously by  Show.

Object-oriented programming

Line[{{0, 1}, {1, 0}}];
FullForm[%]
Show[Graphics[%]];

Line[{{0, 1}, {1, 0}}] === 
      Line[{{0, 1}, {1, 0}}]
Line[{{0, 1}, {1, 0}}] === Line[{{1, 0}, {0, 1}}]

Line[{{0, 1}, {1, 0}}] == 
      Line[{{0, 1}, {1, 0}}]
Line[{{0, 1}, {1, 0}}] == Line[{{1, 0}, {0, 1}}]

A = Line[{{0, 1}, {1, 0}}];
A === Line[{{0, 1}, {1, 0}}]
A === Line[{{1, 0}, {0, 1}}]

A = A
A == Line[{{0, 1}, {1, 0}}]
A == Line[{{1, 0}, {0, 1}}]