From leavens@cs.iastate.edu Tue Aug 28 20:15:20 2001 Date: Tue, 28 Aug 2001 20:15:08 -0500 (CDT) From: "Gary T. Leavens" To: dheck@iastate.edu CC: cs342s@cs.iastate.edu, leavens@cs.iastate.edu In-reply-to: <200108290023.TAA19473@isua3.iastate.edu> (message from Daniel J Heck on Tue, 28 Aug 2001 19:23:17 CDT) Subject: Re: E-mail on Popeye? Daniel, You can use any of the machines in the department to send email. Programs that do this are described in the Com S FAQ list, found from the department web page. One is "pine" and "elm" is another. If you want to use "mail", the -s flag allows you to give a subject. You can also use emacs to send mail. Use C-x m to do that, and press C-c C-c when you're done. Does that help Gary From - Thu Aug 30 16:49:46 2001 Return-Path: Received: from cs.iastate.edu (larch.cs.iastate.edu [129.186.3.5]) by css-1.cs.iastate.edu (8.9.0/8.9.0) with ESMTP id QAA17923 for ; Thu, 30 Aug 2001 16:48:59 -0500 (CDT) Sender: leavens Message-ID: <3B8EB4C3.60C84171@cs.iastate.edu> Date: Thu, 30 Aug 2001 16:48:51 -0500 From: "Gary T. Leavens" Organization: Department of Computer Science, Iowa State University X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/735) X-Accept-Language: de,fr MIME-Version: 1.0 Subject: Question about HW0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit A student wrote: In the first homework, we are asked to list the languages we would be comfortable programming in. How proficient must one be before one is comfortable? Knowledgeable enough of the syntax to be able to read code or knowledgeable enough of the language to be able to code significant amounts without need of a language reference? This is pretty much up to you. It's not such a hard-and-fast or important distinction for htis class. I'd say that it's knowledgeable enough to be able to code lots without needing to look at the language reference for the syntax, although you may still need to look up library routines, etc. -- Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1040 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 From leavens@cs.iastate.edu Tue Sep 4 22:13:23 2001 Date: Tue, 4 Sep 2001 22:13:12 -0500 (CDT) From: "Gary T. Leavens" To: jenbkr@iastate.edu CC: leavens@cs.iastate.edu In-reply-to: <20010905011912.42397.qmail@web12301.mail.yahoo.com> (message from Jenny Golder on Tue, 4 Sep 2001 18:19:12 -0700 (PDT)) Subject: Re: hw0 #11 Jenny, you wrote: > Date: Tue, 4 Sep 2001 18:19:12 -0700 (PDT) > From: Jenny Golder > > I do not understand what Q11c on hw0 is asking. A combination or application is just a procedure call. See section 1.1.3 of Abelson and Sussman's book (http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.3) Sorry I forgot to mention this term explicitly in class. > Also > I can not find in the scheme book where it talks about > if statement formating. We mentioned this a bit in class, and will also discuss it some in discussion sections tomorrow. The Abelson and Sussman book discusses this in Section 1.1.6 (see http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.6). But briefly in Scheme there are if-statements of the form (if b e1 e2), where b is an expression of type boolean, and e1 and e2 are expressions. As an expression (if b e1 e2) has the value of e1 if b has the value true, and (if b e1 e2) has the value of e2 if b has the value false. (In Scheme true is #t and false is #f, technically.) For example, (if #t 1 0) ==> 1 meaning that the value of the expression on the left of the ==> is 1 and (if (equals? 3 (+ 2 1)) 'yes 'no) ==> yes (if (equals? 342 (+ 3 4 2)) 'yes 'no) ==> no BTW, as you can see from the above, the full text of the Abelson and Sussman book seems to be on-line now. Does that help? Gary From leavens@cs.iastate.edu Thu Sep 6 01:09:22 2001 Date: Thu, 6 Sep 2001 01:09:20 -0500 (CDT) From: "Gary T. Leavens" To: dheck@iastate.edu CC: cs342s@cs.iastate.edu, leavens@cs.iastate.edu In-reply-to: <200109060400.XAA18140@isua5.iastate.edu> (message from Daniel J Heck on Wed, 05 Sep 2001 23:00:11 CDT) Subject: Re: A few things I don't understand Dan, you wrote: > About question #11: > > I am getting confused. I have messed around a little in scheme342 and > tried to reproduce something along the lines of an expression like (if b > e1 e2). I took away from our discussions that the meaning of this > expression was essentially that, if b is true, execute e1 and e2. It's > quite possible that I'm wrong. > > I couldn't get this to work, because even if I put each of e1 and e2 in > parentheses within the if statement, it gives me an error. If, on the > other hand, I type a fully parenthesized if statement (e.g. (if 4 > 3)) > and then press return, it asks me for the subsequent function to > execute if true (e.g. (displayln "Guess what! 4 > 3!")) I can then enter > it in and it executes exactly how I want. > > The words "Be careful..." within the problem statement are obviously a > clue into how there is some sort of trick in the question, so I feel > that understanding what this expression means is essential. Please > help. In Scheme's syntax, here are some examples of if expressions, typed in to the interpreter at its prompt "> ", with results on the next line: > (if #t 1 0) 1 > (if (> 4 3) (displayln "4 is greater than 3") (displayln "hmmm")) 4 is greater than 3 > (define x 7) > (define y 2) > (+ (if (>= y x) (- y x) (- x y)) 100) 105 > I believe I have a better understanding of what "begin" and > "combinations" indicate in problems 11b. and 11c., namely, they're the > parallel to the beginning of a function call and the structure behind an > overall application, respectively. Again, I could be wrong. This was supposed to be discussed in sections yesterday, since we covered "begin" very quickly in class on Tuesday. Begin is a special form that evaluates its sub-expressions sequentially, from left to right, and returns the value of the last. It's used to sequence side-effects, for example, since in Scheme the order of evaluation of the arguments of a procedure is not specified. For example, > (begin (display "hi") (display " ") (display "Dan") (newline) 3) hi Dan 3 > (+ 2 (begin (display "hi") (display " ") (display "Dan") (newline) 3)) hi Dan 5 > The lack of a convenient reference for Scheme syntax and concepts at this > point in time is part of what is behind my confusion. I try to listen in > lecture and discussions, and take notes, but some things aren't sinking in. > Thank you for your help. Ah, but there is a Scheme reference that has all the details. It's the Revised(5) Report on Scheme, and it's available in several formats from the resources page off the course web page. I think you'll find it quite handy. Gary From - Tue Sep 11 12:07:23 2001 Return-Path: Received: from cs.iastate.edu (leavens.cs.iastate.edu [129.186.3.47]) by css-1.cs.iastate.edu (8.9.0/8.9.0) with ESMTP id MAA24676; Tue, 11 Sep 2001 12:01:35 -0500 (CDT) Message-ID: <3B9E4342.1F282120@cs.iastate.edu> Date: Tue, 11 Sep 2001 12:00:51 -0500 From: "Gary T. Leavens" Organization: Department of Computer Science, Iowa State University X-Mailer: Mozilla 4.78 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Daniel J Heck CC: Gary Leavens , George Ushakov , Facundo Bromberg Subject: Re: problems with homework 1, problem 1 References: <200109111526.KAA22920@isua1.iastate.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Daniel, I think I figured out your problem. Were you using scheme342typed or scm342typed? If so, lots of parts of HW1, problem 1 won't work. Use the untyped versions of these. -- Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1040 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 From leavens@cs.iastate.edu Tue Sep 18 02:59:12 2001 Date: Tue, 18 Sep 2001 02:59:08 -0500 (CDT) From: "Gary T. Leavens" To: estacy@cs.iastate.edu CC: cs342s@cs.iastate.edu, leavens@cs.iastate.edu In-reply-to: Subject: Re: Quick Question on Problem 5 of HW1 in 342 Eric, You wrote: > As I was looking over my homework to make sure I did it correctly, I had > the following question: by saying whether or not the symbol "occurs twice", > does it mean "EXACTLY" twice (i.e., not 3 times, not 4 times...) or "AT > LEAST" twice? None of the examples given clarified this. It should be at least twice. Thanks for pointing that out. Gary