{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

x 9 s 63

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: heme value, but we do not explicitly pass and return it, as the specification suggests. Instead, we keep the state in a single Scheme global variable, to which all the procedures of the implementation have / example, where we used a shared location access. This is much like instead of passing an explicit argument. By using a single Scheme global variable, we also use as little as possible of our understanding of Scheme effects.   ¢ £ ¥ ¡¥ We still have to choose how to model the store as a Scheme value. We choose the simplest possible model: we represent the store as a list of expressed values, and a reference is a number that denotes a position in the list. A new reference is allocated by appending a new value to the list; and updating the store is modelled by copying over as much of the list as necessary. This representation is extremely inefficient. Ordinary memory operations require approximately constant time to execute, but in our representation these operations require time proportional to the size of the store. No real implementation would ever do this, of course, but it suffices for our purposes. 10 11  @ ¡¦£  @ ¨#£ © ¦£  ¥  § ©¥(¥ ¥ ¥©¥¥ ¥  £& ¢ 6 & 6 ¥3 ¨¥ ¤ ¢ ) '¥  ¤ !7¥  ¦E7   ¥ © ¢   !77 ¥ § © ¢  ¦¦% $¨ § 6 8 ¥ 6¥3 ¨ ¥  § & )  & §  ¨ ¥ 6¥ ©© ¢   9  ¤ &    £  ¦£  ¤¥  § ¥ ¥ © ¢   7 ¥ ¦% ¢  © ¢   ¦ ¨ ¥ © ¢   79  ¤ &    £  § 8 ¥3 ¥ 6¥3 ¥  6¥   8  6 ¥    !¥ E £ BB §   9  ¥ &  £ £  1 © ¢   ¥ %¦£ ¥  § ¥ 6 3 ¥  F ¥ 2¦© ¢ 8 £ ¥ #! G¦ ¤ ¦%¡ & ¢  ¨¨ " F ¥ &  ¤      ¥ ¤  &    £  ¤ F¥ G© ¢   ¥¦%  ¢ ¥¦¨!  £ ¥ © ET¦% ( £  £  !£ ¢  ¥ ¤ &  !0¥  ¦E  3 &  © ¥3 & ) ©& ¥3  §  %1  § & )  & ¤ §...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern