transcribed from p.345 to sec5.5.4
an example of code compilation... the result doesn't match the code in textbook, it seems something is wrong