From leavens@larch.cs.iastate.edu Sun Oct 22 19:49:14 2006 Date: Sun, 22 Oct 2006 19:49:14 -0500 (CDT) From: Gary T. Leavens To: Zachary Arlen Cc: Steve Shaner Subject: Re: Homework Question Hi Zach, On Sun, 22 Oct 2006, Zachary Arlen wrote: > Hi, > > I'm having problems extending the environment from just numbers to numbers + > lists. Could you give me a clue on how to use the extend-env expression properly. > That would be greatly appreciated. Extend-env takes 3 arguments: a list of symbols, a list of Expressed-Values, and an environment. You have to make a list of Expressed-Values by forming Expressed-Values and putting them in a list. You could use, for example, (cons (number->expressed 3) (cons (list->expressed (list (number->expressed 2))) '())) to make a list of 2 expressed values, the first of which is a number, and the second of which is a list of expressed values itself. Does that help? Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 ---------------------------- From leavens@larch.cs.iastate.edu Mon Oct 23 16:37:26 2006 Date: Mon, 23 Oct 2006 16:37:26 -0500 (CDT) From: Gary T. Leavens To: Adam M Weber Cc: Steve Shaner Subject: Re: Homework 7 Hi Adam, On Mon, 23 Oct 2006, Adam M Weber wrote: > For question 3 do we assume the arguments given in the print and minus > primitives come from the args list? Yes, just like for the other primitives. Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 -------------- From leavens@larch.cs.iastate.edu Mon Oct 23 20:42:12 2006 Date: Mon, 23 Oct 2006 20:42:12 -0500 (CDT) From: Gary T. Leavens To: Adam M Weber Cc: Steve Shaner Subject: RE: homework 7 #5 Hi Adam, On Mon, 23 Oct 2006, Adam M Weber wrote: > I am still stuck on the list one. Do you use the scheme list to transform > this? I'm not sure what your question means. Sorry. Can you clarify? My first suggestion is to think about the types. A second one is that it may help to just play with some examples in the interactions window. Try doing (define args (list (number->expressed 3) (number->expressed 4))) for example, and then see what that looks like, and experiment with what would make something that is an expressed value. You may want to use the typed interpreter, to do this, try pressing "Run" and then type in the interactions window: (type-check-and-eval-loop) You'll have to load the interpreter and do whatever requires are needed. It may be a little slow working with the requires. Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 ----------------------------------