From leavens@larch.cs.iastate.edu Wed Jan 19 20:04:04 2005 Date: Wed, 19 Jan 2005 20:04:04 -0600 (CST) From: Gary T. Leavens To: Matthew J. Ring Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: Re: Homework 1 output Hi Matt, On Wed, 19 Jan 2005, Matthew J. Ring wrote: > I'm typing up my answers for the homework but I'm not sure the best way to > do this. It says to write up a transcript for several parts. Should I be > doing this in the interactions (bottom pane) or the definitions (top pane) > section? The transcript should be done in the interactions section (bottom pane of DrScheme). > It seems easier to do everything in the interactions section, but > then I'm not sure the best way to indicate what each section is. > > Suggestions? Use a comment or print something. To use a comment, just make a comment -- text from a semicolon (;) to the next newline is a comment -- in your transcript at the prompt, like: ;; part c ;;;;;;;;;;;;;;;; To print something, you could do (displayln "******* part c *********") at the prompt. This has the advantage that it synchronizes with the next prompt. You could even define a helping procedure, in the definitions section, that takes the part as an argument: (define marker "****************") (define starting-part (lambda (part) (displayln marker " part " part " " marker))) Now when you execute (starting-part "c") it prints out **************** part c **************** 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@cs.iastate.edu Wed Jan 19 22:03:14 2005 Date: Wed, 19 Jan 2005 22:03:13 -0600 (CST) From: Gary T. Leavens To: Sayan Ranu Cc: cs342s@cs.iastate.edu Subject: Re: homework 1 question 1 j Hi Sayan, On Wed, 19 Jan 2005, Sayan Ranu wrote: > Is it ok to draw the box diagram by hand, or do we have to draw it in something > like word or paint ? (for 1j) It's fine to draw it by hand. 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@cs.iastate.edu Sat Jan 22 20:17:40 2005 Date: Sat, 22 Jan 2005 20:17:42 -0600 (CST) From: Gary T. Leavens To: Kendra Schmid Cc: cs342s@cs.iastate.edu Subject: Re: Homework 1, part 2 Hi Kendra, You don't have to write deftypes for them, although I recommend it as one of the tips. Even if you do, you don't have to get them to have the right syntax. However, if you choose to do that, you can look in http://www.cs.iastate.edu/~leavens/ComS342/docs/typedscm_toc.html or http://www.cs.iastate.edu/~leavens/ComS342/docs/typedscm.pdf (and these links are available from the course resources page) for notational details. On Sat, 22 Jan 2005, Kendra Schmid wrote: > In part two of this homework, the questions ask us to write procedures. Does > this include writing deftypes for them? 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 Jan 24 22:13:33 2005 Date: Mon, 24 Jan 2005 22:13:33 -0600 (CST) From: Gary T. Leavens To: Matthew J. Ring Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: Re: non-number? Hi Matt, On Mon, 24 Jan 2005, Matthew J. Ring wrote: > I know there is a special keyword for "number?" to determine whether or not > an atom is a number. Is there a way to reverse that logic without writing a > function to do it? > > ---------------------- > Example (in Java): > > if (! True) { /* do something */ } > ---------------------- > > Some Scheme equivalent to the (!) character? Yes, the procedure "not" in Scheme is like Java's ! operator. 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@cs.iastate.edu Mon Jan 24 22:25:51 2005 Date: Mon, 24 Jan 2005 22:25:52 -0600 (CST) From: Gary T. Leavens To: Matthew J. Ring Cc: cs342s@cs.iastate.edu Subject: Re: another question Hi Matt, On Mon, 24 Jan 2005, Matthew J. Ring wrote: > Ok, while you're contemplating my previous e-mail, I tried to run the test > scripts for question 3 (with marginal success). If I follow the directions > while the "all-numbers.txt" file is loaded in the definitions file, I can > load the file, but get an error. Then I can run the test and it works fine > (except for the warning). I don't understand, so there's some misunderstanding here. It should be "all-numbers.tst" not "all-number.txt" You aren't supposed to load "all-numbers.tst", but instead you should evaluate (test-hw1 "all-numbers") in the interaction pane, after you have written and run the code for the all-numbers? procedure in the definitions pane. If you instead try (load "all-numbers.tst") that won't work and you'll get an error like: > (load "all-numbers.tst") . open-input-file: cannot open input file: "D:\classes\cs342\homework\current\solutions\hw1\all-numbers.tst" (The system cannot find the file specified.; errno=2) Is that what you are seeing? > However, if I open a new DrScheme window without the file loaded in the > definitions pane, it will give me an error. (e.g. "File not found in > 'C:\Program Files\PLT\' "). I understand this to be a problem with the > default directory, but I'm not sure why it worked in one instance and not in > the other. I searched the resources on the web site but couldn't find > anything applicable. It sounds like you don't have the teachpack and library for 342 installed correctly. Look in the course Scheme library web page: http://www.cs.iastate.edu/~leavens/ComS342/library.shtml and pay particular attention to the part about customizing your copy of localize.scm and to customizing the teachpack file. 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 ----------------------------