From lliao@ren.eecis.udel.edu Sat Oct 12 23:31:19 2002 Date: Sat, 12 Oct 2002 23:30:39 -0400 (EDT) From: Li Liao To: Hyunok Park Subject: Re: question for hw2 > > > > Your initial state ([], []) is not right. The dictionary stack cannot be > > empty; it must have at least one dictionary, even if that dictionary > > may be empty (and it should be empty at the beginning) > > > > Actually, that's what I was about to ask you right after I sent you > previous email. How do I initialize the dictionary at the very begining ( > an empty dictionary)? Please take a look at the sample code from lecture 8 (posted as message 12 on the bboard) to see how to initialize a dict as empty. > > > According to the homework sheet, begin saves the current bindings. It > seems to me that begin doesn't do anything until end comes up. When end > comes up, then I just go back to previous bindings. Is that right? > It is right. But do you know how to "save the current bindings"? Certainly it will do any good if "begin doesn't do anything". Also I hope you understand what you should do when you then "just go back to previous bindings." Think hard why we have a stack of dictionaries instead of just one dictionary, and what operations we have for a stack? I hope this hint will bring you to the answer. Li