source-academy / cs1101s

1 stars 0 forks source link

How do we represent lists in the environment model? #6

Open martin-henz opened 3 years ago

martin-henz commented 3 years ago

Question: How do we represent lists in the environment model?

mrqorib commented 3 years ago

Answer: A list is either null or a pair whose tail is a list. In the environment model, we represent pairs as boxes with two slots, see Lecture L8, Slide 70. The value null is a primitive value. If a name is bound to null in a frame, we write null inside the frame