From leavens@larch.cs.iastate.edu Sat Feb 19 19:06:29 2005 Date: Sat, 19 Feb 2005 19:06:29 -0600 (CST) From: Gary T. Leavens To: Sayan Ranu , Brian Patterson Cc: Daniel Patanroi Subject: Re: hw5 q1 Hi Brian, Sayan, Thanks Brian that's correct. I have updated the homework to include the note about the meaning of the quote special form in problem one also. On Sat, 19 Feb 2005, Brian Patterson wrote: > See the very last note in 2(b). Not sure why this wasn't included in part > 1(a) instead of there. > > So yes. > > Brian > > On Feb 19, 2005, at 5:44 PM, Sayan Ranu wrote: > >> hi, >> in q 1, do u mean (x 'y) for (x (quote y)) ? Thanks >> >> Sayan 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 Sat Feb 19 20:23:25 2005 Date: Sat, 19 Feb 2005 20:23:25 -0600 (CST) From: Gary T. Leavens To: Sayan Ranu Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: Re: hw5 q2b Hi Sayan, On Sat, 19 Feb 2005, Sayan Ranu wrote: > Hi, > one more question...in a test case of 2b it has > (free-vars (parse-lambda-1-quote-exp '(quote z))) = the-empty-set > > I can't understand why z isn't a free variable ? Because it's not in a var-exp. Free variables only occur in var-exps. This is in a quote-exp. 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 Sun Feb 27 21:05:06 2005 Date: Sun, 27 Feb 2005 21:05:06 -0600 (CST) From: Gary T. Leavens To: Matthew J. Ring Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: Re: Hwk5, Q3c Hi Matt, I see that Brian was also answering this at the same time. His answer is right but I can't abandon mine... so here it is :-) On Sun, 27 Feb 2005, Matthew J. Ring wrote: > This is from a test case for testing the bound? procedure. > > (bound? 'z (parse-lambda-1-quote-exp ''z)) > ==> #t > EXPECTED: #f The expected result is correct in this case. > I'm not sure why this should be false, since > > (bound? 'x (quote x)) ==> #t Where are you getting this from? If that's in your program, it's wrong. We do have in problem 3b: (bound-vars (parse-lambda-1-quote-exp '(quote z))) = the-empty-set I will add some extra examples to homework five problem 3 part c to clarify. But in essence, a variable (symbol) occurs bound in an expression if and only if there is some subexpression that is a lambda expression whose body contains a free occurrence of that variable as a var-exp, and such that that lambda expression declares the variable in question. Quoted symbols are not var-exps. 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 Feb 28 19:28:26 2005 Date: Mon, 28 Feb 2005 19:28:26 -0600 (CST) From: Gary T. Leavens To: Adam Nelson Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: Re: Homework 5B questions Hi Adam, On Mon, 28 Feb 2005, Adam Nelson wrote: > Do we have to use helpers from lexical-addr-exp, lambda-if-exp, and lexical- > addr or just the first two? You'll need all 3. > Also, do I understand correctly that we have to use our free-vars expression > from the last homework for it? You need to get a list of the free variables, so that would be useful... > I'm still having a bit of trouble getting started on this, so any tips you > could provide would be appreciated. I understand what the given helping > functions are supposed to do, but I'm not quite sure how to get started on > them. Think about a tail recursion compuation for them that would do what is required... 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 Feb 28 20:28:37 2005 Date: Mon, 28 Feb 2005 20:28:36 -0600 (CST) From: Gary T. Leavens To: Adam Nelson Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: Re: Homework 5B questions Hi Adam, On Mon, 28 Feb 2005, Adam Nelson wrote: >>> Also, do I understand correctly that we have to use our free-vars > expression >>> from the last homework for it? >> >> You need to get a list of the free variables, so that would be useful... > > Follow-up question: > Will we need to include this in the provided printout, or can we just make a > note that we used it, since we have already handed it in? I think it's okay just to note that you used it. 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 --------------------------------