Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 482 Bytes

2.24.md

File metadata and controls

23 lines (17 loc) · 482 Bytes

2.24

Question

Suppose we evaluate the expression (list 1 (list 2 (list 3 4))). Give the result printed by the interpreter, the corresponding box-and-pointer structure, and the interpretation of this as a tree (as in figure 2.6).

Answer

(1 (2 (3 4)))

Box-and-pointer and tree diagrams share the same structure:

flowchart LR
  1234("(1 (2 (3 4)))") --> 1
  1234 --> 234
  234("(2 (3 4))") --> 2
  234 --> 34
  34("(3 4)") --> 3
  34 --> 4
Loading