From leavens@cs.iastate.edu Thu Jan 22 17:34:11 2004 Date: Thu, 22 Jan 2004 17:33:57 -0600 (CST) From: Gary T. Leavens To: Neeraj Khanolkar Cc: Computer Science 342 Staff Subject: Re: Its all working now Hi Neeraj, On Thu, 22 Jan 2004, Neeraj Khanolkar wrote: > I modified the batch file according to your instructions in the README > file (didn't want to get the untyped batch file and reconfigure it..too > lazy). > And its all working fine now. Scheme on WinME :) Great. It appears that the type error in simple-interpreter.scm is because the type simple-arith-expr isn't really declared anywhere. So the second deftype is wrong, in a sense. -- 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 Fri Jan 23 17:14:30 2004 Date: Fri, 23 Jan 2004 17:14:15 -0600 (CST) From: Gary T. Leavens To: Neeraj Khanolkar Cc: Computer Science 342 Staff Subject: Re: Scheme + WinME Hi Neeraj, On Fri, 23 Jan 2004, Neeraj Khanolkar wrote: > Hi Gary, > > After sending my earlier message, I added the environment variable (like > it says in chez.init) which took care of all loading problems. > So I apologize about the needless latter half of the message. Ah, good. > However this still remains: > I commented this > ;;;(setq load-path (cons "~/emacs" (cons "/usr/unsup/emacs" load-path))) > in your .emacs file and things still seem to work smoothly. But will this > show up later? No, that's not a problem. It's not needed if you don't have such directories. -- 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 Sun Jan 25 15:42:02 2004 Date: Sun, 25 Jan 2004 15:14:30 -0600 (CST) From: Gary T. Leavens To: Jacob Lynch Cc: Computer Science 342 Staff Subject: Re: homework 1 question about part m Hi Jacob, On Sun, 25 Jan 2004, Jacob Lynch wrote: > I have a real quick question for you. In the homework, you have this: > > m. (5 points) > Make a transcript showing that Scheme's car and cdr procedures > do not change their arguments. (Hint: you may want to use define.) > > I do not understand the question. Car and cdr do change their arguments. > Car returns the first element of the list, and cdr returns the list minus > the first element. That is how I interpreted it. Thanks for any help! No, car and cdr leave the objects that are their arguments unchanged. They return an object that is either the first element of the list that is their argument (for car) or the rest of the list (for cdr), but if you call (cdr ls) the list ls is itself unchanged. This is what the transcript is supposed to show. -- 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 Tue Jan 27 08:28:24 2004 Date: Tue, 27 Jan 2004 08:26:51 -0600 (CST) From: Gary T. Leavens To: irisch@iastate.edu Cc: cs342s@cs.iastate.edu Subject: Re: How debug works in Scheme? Hi Iris, On Tue, 27 Jan 2004 irisch@iastate.edu wrote: > Could you tell me how debug works in scheme342? > type 'debug', and then do what command??..... > Thank you very much. See the file debugging-chez-scheme.txt in the directory $PUB/docs/ which is also available from the course resources web page. -- 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 Tue Jan 27 11:14:33 2004 Date: Tue, 27 Jan 2004 11:14:02 -0600 (CST) From: Gary T. Leavens To: Eric Douglas Nath Cc: cs342s@cs.iastate.edu Subject: Re: HW1 quick questions.... Hi Eric, On Tue, 27 Jan 2004, Eric Douglas Nath wrote: > Hey, I know it's getting to be that time, but I am still having > trouble with the if statement problems for homework 1, parts d > through f. The syntax is still a little confusing to me, as well as > how you set a value to a function or how you get it to return what > you want. Any hints would be appreciated =) In Scheme the syntax for if expresions is ::= ( if ) | ... For example, (if (null? lst) '() (f (car lst) (cdr lst))) which can also be written as (if (null? lst) '() (f (car lst) (cdr lst))) for clarity. See the Revised(5) report on Scheme for more details. See the library for the course, $PUB/lib for lots of examples. The value returned in Scheme is the last thing executed in a procedure's body; there's no "return" statement. So for example, in (define add1 (lambda (x) (+ x 1))) the result returned by a call to add1 is the value of (+ x 1) after the actual parameter is passed to the formal. For example, (add1 3) ==> 4 (add1 342) ==> 343 The same holds in a if. For example, the value of (if (< x y) x y) returns the smaller of x or y. Thus you could write: (define min (lambda (x y) (if (< x y) x y))) 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@cs.iastate.edu Tue Jan 27 22:27:23 2004 Date: Tue, 27 Jan 2004 22:26:21 -0600 (CST) From: Gary T. Leavens To: David Breutzmann Cc: Computer Science 342 Staff Subject: Re: Running Scheme at home Hi David, On Tue, 27 Jan 2004, David Breutzmann wrote: > I have a problem with the homeowrk due on thursday. I have > solutions (developed on my home computer and scheme inturpreter) that I > believe are correct after thurogh self testing, but I can't get your > test to work becuase I can't seem to run the scheme programs as > described on the course website. > > This is in my .cshrc file > > setenv PATH /usr/local/bin:$PATH This is your .cshrc file at home or at ISU's Com S machines? > and I tried the commends scm, scheme, and scheme342. And do they work? You have to adjust the paths in them and the localize.scm file's paths. If this is for the course on the ISU machines, you need to follow homework 0 correctly. It says: setenv PATH "${PATH}:/home/course/cs342/public/bin" our commands are not in /usr/local/bin, but in $PUB/bin. Also are you really using tcsh or csh, if not, you don't want to edit the .cshrc file, but the .bashrc file. > Also, I have tried to run your test scripts at home, but I've had no > luck in getting them to work. It works for me (and others) under both Chez Scheme and SCM. Look at the course running scheme web page. > When I try to load the entire course > library DrScheme it won't load it all, and when I picked out loading > only the "test-homework.scm" file I got several errors when I tried to > run your test script, error which led me to believe that the test > script had dependancies on other files I've never gotten the course libraries, which you need, to work under DrScheme. You're welcome to try, but I'm not sure how to do it (it seemed very hard to me and even others in the DrScheme project). > I was hoping you could tell me which files, out of the library, I need > to load to operate the test script; or that you could publish a test > script not dependent upon the course libraries; but any help you could > offer would be appreciated. You need all the ones mentioned in the commands and test-homework.scm. These include: $PUB/lib/localize.scm $PUB/lib/standardize-chez.scm $PUB/lib/chez-init.scm $PUB/lib/type-check-ignore-types-at-runtime.scm $PUB/lib/type-check-and-eval.scm Also slib and all the files referenced by the above (including type-check* and test-homework.scm). See the course library.shtml page and the README.txt for the library. You're responsible for your own system. Although we'll try to help, if you can't get it to work you should work on the ISU systems, which are supported by us. One compromise is to develop solutions at home and test by shipping your files to the Com S systems. Let me know if you have more problems. -- 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 Tue Jan 27 22:33:07 2004 Date: Tue, 27 Jan 2004 22:31:25 -0600 (CST) From: Gary T. Leavens To: David Breutzmann Cc: Computer Science 342 Staff Subject: Re: Running Scheme at home Hi David, Oops, when I said... On Tue, 27 Jan 2004, Gary T. Leavens wrote: > > and I tried the commends scm, scheme, and scheme342. > > And do they work? You have to adjust the paths in them and the > localize.scm file's paths. I should have said, if those are for your home machine. If not, then you can't modify localize.scm on the ISU machines, of cousre, so ignore that. Sorry. -- 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 28 22:13:29 2004 Date: Wed, 28 Jan 2004 22:12:29 -0600 (CST) From: Gary T. Leavens To: Ryan Hanks Cc: Computer Science 342 Staff Subject: Re: scheme libraries Hi Ryan, On Wed, 28 Jan 2004, Ryan Hanks wrote: > I'm trying to make sure that my local copy of scheme will for all the > programming we have to do for class. In my attempt to customize the > "localize.scm" I noticed that there are some paths that I need to change. > If I am running Chez Scheme in a Windows environment, do I need to do > anything differently besides change the paths to their respective paths on > the Windows filesystem? Also, what is the purpose of the homework directory > and what should be in this directory on my machine? In theory, everything you need to customize should be in the file "localize.scm", but you definitely need to change the paths in that file. The purpose of the homework treachery is mostly to hold the subdirectories where the test cases are, for example the "hw1" subdirectory. Let me know if you have other questions about this. -- 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 Thu Jan 29 12:53:19 2004 Date: Thu, 29 Jan 2004 11:54:34 -0600 (CST) From: Gary T. Leavens To: Michael McCown Cc: cs342s@cs.iastate.edu Subject: Re: occurs-twice error? Hi Michael, On Thu, 29 Jan 2004, Michael McCown wrote: > I've spent alot of hours on this one program and can't understand why I > get the following error msg when running the test: > > > (test-hw1 "occurs-twice") > loading /home/course/cs342/public/homework/hw1/occurs-twice.tst ... > > > Test case of $Date: 2001/09/07 06:34:07 $ > > (occurs-twice? 'hmm '()) > ==> #f > (occurs-twice? 'hmm '(hmm)) > > Error: attempt to apply non-procedure #. > Type (debug) to enter the debugger. We talked about this in person, but others may be interested in the results. First, it's good to see us when you have such a problem. Second, the error above means that you're trying to apply the result of a command, which meant in your case you had extra parentheses around the statement (set! cntr (+ 1 cntr)), which returns void. That is, ( (set! cntr (+ 1 cntr)) ) causes that error. We also noted that many of these problems would have been found by the type checker, scheme342typed. When you have problems like this, I recommend trying that. -- 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 Thu Jan 29 13:05:00 2004 Date: Thu, 29 Jan 2004 12:17:43 -0600 (CST) From: Gary T. Leavens To: Luan Chan Cc: cs342s@cs.iastate.edu Subject: Re: Testing Homework Question... Hi Luan, On Thu, 29 Jan 2004, Luan Chan wrote: > I was wondering how I get the all-numbers.tst file. In the setting up > scheme on your home computer it doesn't mention anything about the testing > of the programs. I have everything else set up correctly and when I run > (test-hw1 "all-numbers") it says it can't open the input file > "path"/all-numbers.tst. Was this file not included in the class library and > if now where can I find this file? Same question for the occurs-twice.tst. You'll have to transfer a copy of the homework directory to your home computer and edit the localize.scm file to have the right path to it. These files aren't in the course library. I'll try to work on a script to make a zip file with the homework directory in it, but at the moment I can't reach the course directory $PUB, due to some network problem. -- 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 Thu Jan 29 13:10:38 2004 Date: Thu, 29 Jan 2004 13:07:12 -0600 (CST) From: Gary T. Leavens To: Jacob Bennett Cc: cs342s@cs.iastate.edu Subject: Re: cs342 hw1 (machines down) Hi Jacob, On Thu, 29 Jan 2004, Jacob Bennett wrote: > I'm having problems connecting to the cs machines. SSG told be there was a problem with > the nameserver. I have problems 3 and 4 done and tested, and 5 is mostly done, but I > still > need to test it. I am still unable to log on to the cs machines and finish 5 and the > transcripts. Will it be a problem if I hand them in late? The problem should be fixed now, but come to class and I won't penalize you or others for turning them in by 5pm today. -- 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 ------------------------------------------------