From leavens@larch.cs.iastate.edu Mon Sep 4 12:03:55 2006 Date: Mon, 4 Sep 2006 12:03:55 -0500 (CDT) From: Gary T. Leavens To: Bancha Doungratanaex-chai Cc: Steve Shaner Subject: Re: Displayln Hi Bancha, On Mon, 4 Sep 2006, Bancha Doungratanaex-chai wrote: > I have read Q&A archives regarding homework 1. In one of these email > mentioned that there is no displayln procedure call in this Typedscm > language. Can I use it based on current language that we are using right > now? Thank you for your time. There is a displayln procedure in the typedscm language, so you can use that. Welcome to DrScheme, version 352. Language: Typedscm, typed extension to EoPL(2e). Teachpack: C:\cygwin\usr\local\PLT\collects\teachpack\drscheme-342-teachpack.scm. > (displayln "it works") it works > 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 Sep 4 21:07:26 2006 Date: Mon, 4 Sep 2006 21:07:26 -0500 (CDT) From: Gary T. Leavens To: Adam M Weber Cc: Steve Shaner Subject: Re: cs 342 hw1 number 1L Hi Adam, On Mon, 4 Sep 2006, Adam M Weber wrote: > Can you please clarify what you are looking for in this question I am > not sure I understand? For problem 1(l), you should write an expression that uses the value of the variable lst to make the given lists. For example if lst had the value (a b) and you wanted to make the list (x a b) from lst, you would write the expression: (cons 'x lst) 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 Sep 4 22:51:08 2006 Date: Mon, 4 Sep 2006 22:51:08 -0500 (CDT) From: Gary T. Leavens To: Adam M Weber Cc: Steve Shaner Subject: Re: cs 342 question 4 Hi Adam, On Mon, 4 Sep 2006, Adam M Weber wrote: > What is meant by any kind of non-circular data in scheme? Circular data is data that contains pointers to itself. For example: > (define x (cons 3 '())) > (set-cdr! x x) > (car x) 3 > (cadr x) 3 > (caddr x) 3 > How do you declare this? There's no way to say that some data is not supposed to be circular in Scheme. 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 Sep 4 23:40:51 2006 Date: Mon, 4 Sep 2006 23:40:51 -0500 (CDT) From: Gary T. Leavens To: Adam M Weber Subject: RE: cs 342 question 4 Hi Adam, On Mon, 4 Sep 2006, Adam M Weber wrote: > Do you just check to see if it is a list then? Ah, I see now. Sorry. In question 4 you can assume that the list is non-circular. But you have to check each top-level element to see if it's a number. See chapter 2 of the Little Schemer. 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 -------------------------------------