From - Tue Sep 25 10:20:53 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 KAA26768; Tue, 25 Sep 2001 10:00:00 -0500 (CDT) Message-ID: <3BB09BB7.1D6A27DD@cs.iastate.edu> Date: Tue, 25 Sep 2001 09:59:04 -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: Aaron R Forsyth CC: Gary Leavens , George Ushakov , Facundo Bromberg Subject: Re: Homework 2 Questions References: <5.1.0.14.2.20010924231439.00a82970@forsytha.mail.iastate.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron, Aaron R Forsyth wrote: > I have a question on HW2 problem 2. I don't understand what they mean by > rewrite the grammar. How do you write a grammar? I must have missed > that part in the book, and can't seem to find it. We haven't yet discussed how to write grammars in class, but will do that today. See chapter 1 of the Essentials of Programming Languages book, section 1.1.2. > Also, for problems 5 and 6, the question is what function does this > compute? Are we supposed to write down what the result of the function will > be or what the function is or what? You're supposed to describe (in English), what the function does. Hope that helps, let me know if it doesn't -- 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 - Thu Sep 27 10:10:21 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 KAA23887; Thu, 27 Sep 2001 10:07:57 -0500 (CDT) Message-ID: <3BB34079.7E737224@cs.iastate.edu> Date: Thu, 27 Sep 2001 10:06:33 -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: Muhammad Asif Rahim CC: Georgiy A Ushakov , Facundo Bromberg Subject: Re: Questions about Exam 1 References: <5.0.1.4.2.20010926224921.009f0200@gushakov.mail.iastate.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Muhammad, Thanks to George for answering some of this. I'm sorry to be so slow in replying. Georgiy A Ushakov wrote: > At 08:47 PM 9/26/01 -0500, you wrote: > > >1. When you say give examples for Simple and Scheme - don't you mean > >examples for either oneone of them since in class you said that when we > >were developing SImple, we were actually developing Scheme? > > Yes, since we have tried to model our language Simple after Scheme, because > they share the same design goals more or less, you will be safe producing > Scheme's examples, I suppose. Yes, as I mentioned at the end, I was steering the design of Simple towards what is in Scheme. While there were some small differences, I think the goals of our design (simplicity, generality, manipulation of programs as data) led to something that is remarkably similar. Som I'm using "or" in the computing sense of one or the other or both, not in the (usual English) sense of one or the other but not both. So I agree with George's answer, that there isn't much difference between Simple and Scheme. > >2. What exactly does the term "regularity of a programming language" mean? > >It would be great if you could give some examples relating to Scheme and/ > >or C++ (or Java) > > I leave this for the professor to answer, but my intuition is that > regularity of the language has something to do with regular expressions. > ... I have to differ from George on this one. A language is "regular" if it has rules with few exceptions. For example, in Scheme, we form applications by putting the procedure in the root position of the syntactic form, and this is done very regularly, because we don't make exceptions for procedures like + or *. In Scheme, an application looks like (+ 3 4) or (f 3 4) regardless of what the procedure is. That's regularity. It's related to simplicity, since it makes the language simpler, and it makes the language somewhat easier to learn. -- 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 Sun Sep 30 01:40:27 2001 Date: Sun, 30 Sep 2001 01:40:25 -0500 (CDT) From: "Gary T. Leavens" To: dongshin_kim@yahoo.com CC: gushakov@iastate.edu, leavens@cs.iastate.edu In-reply-to: <000c01c14954$1a5c6d70$a4ad0a41@money> (dongshin_kim@yahoo.com) Subject: Re: Question about homework2. Dong-Shin Kim, You wrote: > I am currently solving homework problem 2. > I don't understand "Rewrite the grammar". > Does it mean that we have to change ? > Actually, itself doesn't have any Kleene star and plus notations. > Or do we need to change all the part of grammar ... [?] The authors of the textbook are, in this problem, thinking of the group of grammar rules near the bottom of p. 6 as the grammar for . You can consider the rule to be the start rule for the grammar. So yes, you need to rewrite the rules for , , and in that grammar near the bottom of p. 6. Does that help? Gary From - Tue Oct 2 13:08:58 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 LAA23585; Tue, 2 Oct 2001 11:28:33 -0500 (CDT) Message-ID: <3BB9EAF0.2B4584BC@cs.iastate.edu> Date: Tue, 02 Oct 2001 11:27:28 -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 CC: Facundo Bromberg , George Ushakov , "Yuriy I. Gettya" Subject: Re: Fw: Typed Chez Scheme v6.0a for Win32 References: <001201c14b5b$0dded8e0$4443ba81@cs.iastate.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Yuriy, To set up Chez Scheme for windows, you'll need to do something like what I do. See the "Scheme Library" web page for details. First, you need to get a copy of the library and unzip. Also get a copy of the file localize.scm from $PUB/lib (or the Scheme Library web page) and edit it. You have to get the local paths correct. Then you'll need a script file, like scheme342typed.bat (or if you have cygwin, like scheme342typed-cygwin) which you can copy and edit from $PUB/bin. You will probably also want the scheme342 and scheme342untyped batch (or shell script) files. These have to be on your PATH. If that doesn't work, let me know more details. > > > I'm having trouble with setting up Chez Scheme v6.0a for Win32 to work > with > > type checker. > > Any clues? > > Also, what is the default directory this proggie looks for files that I > tell > > it to (load "blah.scm"), ie: relative path. -- 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 Wed Oct 3 10:24:17 2001 MIME-Version: 1.0 Date: Wed, 03 Oct 2001 10:23:03 -0500 From: "Gary T. Leavens" Organization: Department of Computer Science, Iowa State University X-Accept-Language: en To: "Mark M. Lanning" CC: Gary Leavens , George Ushakov , Facundo Bromberg Subject: Re: Question about the typed checker Content-Type: text/plain; charset=us-ascii X-Status: X-Keywords: X-UID: 23 Mark, You just need to put your code in a file which includes a defrep declaration form. The defrep stuff only works on code in files, and doesn't work at the interactive loop. The problem description specifically says that you are to copy our file and put your code in it, and if you do that it will work. I'm sorry I didn't say anything about this aspect... "Mark M. Lanning" wrote: > I was wondering if the type checker really is working or if there is > something wrong with my segment of code that I am getting a error in the > typed checker. > > I first type in the deftype: > > typed> (deftype set-remove > (forall (T) (-> (T (set-of T)) (set-of T)))) > set-remove : (forall (t) (-> (t (set-of t)) (set-of t))) > > Which looks right so far.. > > But when I type in my code I get a expected type of variable definition > error. > > typed> (define set-remove > (lambda (sym list) > ; [...] > ) > ) > ) > : lines 3 to 8: Expected type of variable and definition > differ > Variable: set-remove > Type from deftype or uses : (forall (t) (-> (t (set-of t)) (set-of > t))) > Type of defining expression: (forall (t) (-> (t (list-of t)) (list-of > t))) > Skipping evaluation because of the type errors... > typed> > > What do I need to change with this simple function so that it actually > works? I don't understand at all what is wrong with my code because I > know for a fact that it runs fine for any input.. number, symbol or > whatever. > > Any ideas would greatly help considering how much time this will take > and how many tests are this week. > > Thanks, > Mark M. Lanning -- 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 - Wed Oct 3 20:11:42 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 TAA11100; Wed, 3 Oct 2001 19:45:48 -0500 (CDT) Message-ID: <3BBBB0ED.2A1410C7@cs.iastate.edu> Date: Wed, 03 Oct 2001 19:44:29 -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: "Mark M. Lanning" Subject: Re: Question about the typed checker References: <000001c14c6a$cc0616c0$777ba8c0@www.starlightsoftware.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mark, "Mark M. Lanning" wrote: > I know your not suppose to help but I keep getting errors trying to use > the type checker. No, I'm happy to help when you don't understand something like this. > I get the following when I load my scheme program.. > > typed> (load "set-ops.scm") > Type checking "set-ops.scm" ... > set-ops.scm: line 194: Operator and argument types don't match > Offending call: (set-union (set-one-elem sets1) (set-union-list > (set-rest sets1))) > Operator type : (forall (t) (-> ((list-of t) (list-of t)) (list-of > t))) > Argument type list: ((forall (t) t) (forall (t) t)) Here the problem is that you're using set-one-elem on sets1 and set-rest on sets1, where the variable sets1 has the type (forall (t) (list-of (set-of t))); in other words, you shouldn't be using set-one-elem on something that is, abstractly, a list, like sets1. > set-ops.scm: lines 207 to 211: Expected type of variable and definition > differ > Variable: set-union* > Type from deftype or uses : (forall (t) (-> ((list-of t) ...) > (list-of t))) > Type of defining expression: (forall (t) (-> (t ...) (list-of t))) > ... done type checking "set-ops.scm" > This is probably related to the earlier problem. I think if you fix that, this will go away... Also, your code for set-union* has a similar problem, in that it tests what is abstractly a list (i.e., args) using set-empty?, but it should use null? for that. Even better, there's no reason for set-union* to test to see if the argument list is null if the procedure it calls does that itself. -- 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 Thu Oct 4 00:57:32 2001 Date: Thu, 4 Oct 2001 00:57:29 -0500 (CDT) From: "Gary T. Leavens" To: dfaden@iastate.edu CC: cs342s@cs.iastate.edu, leavens@cs.iastate.edu In-reply-to: <200110040247.VAA26879@isua2.iastate.edu> (message from David Faden on Wed, 03 Oct 2001 21:47:29 CDT) Subject: Re: HW2 problem 9: # : void David, > When running (test-hw2 "merge") on my code for hw 2 problem 9 under > scm342typed, the message "All tests passed!" is printed. A moment later, > however, "# : void" is printed to the screen. > Does the message "# : void" indicate that there is something > wrong with my code? No. The actual explanation is that the type of test-hw2 is (-> (string) void) and so when you call (test-hw2 "merge") you get a side-effect (running the tests), and the result of the expression is unspecified. In SCM, this is printed as #. The type void is because that's the return type of test-hw2. Gary From - Thu Oct 4 12:02:22 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 LAA01350; Thu, 4 Oct 2001 11:39:17 -0500 (CDT) Message-ID: <3BBC9061.4AD6D138@cs.iastate.edu> Date: Thu, 04 Oct 2001 11:37:54 -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: Randy Mersch Subject: Re: HW2, problem 7 set-union* References: <200110041614.f94GEWv6026252@mailhub-1.iastate.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Randy, Randy Mersch wrote: > I still can't get [set-union*] to work, here is my code so far. I have changed it > quite a > bit though, I see that it takes in a list, but I don't know if it knows that the > type is a list of sets, is there some kind of type conversion? Ah, your code is close. You need to make two changes. First, if you want a procedure to have a type with any number of arguments, you need to use the "unrestricted" lambda form, which has no parentheses around the argument: like (lambda args Second, you should either call set-union-list or you should use apply in the recursive call to set-union*. When you have an unrestricted lambda, the calls have to pass arguments not in a list, but in the body, the formal is considered to be a list. For this reason, if you aren't calling a helper, and if you want to recurse directly, you need to use apply. See the code we gave you for the method "set", for how to do this, and look at how "apply" is used in the recursive calls. -- 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 Sun Oct 7 11:15:05 2001 Date: Sun, 7 Oct 2001 11:14:57 -0500 (CDT) From: "Gary T. Leavens" To: dheck@iastate.edu CC: cs342s@cs.iastate.edu, leavens@cs.iastate.edu In-reply-to: <200110070411.XAA05269@isua1.iastate.edu> (message from Daniel J Heck on Sat, 06 Oct 2001 23:11:58 CDT) Subject: Re: Question Dan, > ..., but I am still not sure about what > the format of deftype expressions means. > > Let's take an example: > > (deftype set-size (forall (T) (-> ((set-of T)) number))) > > I can sort of see how this comes together. A function called set-size > takes a 'set-of T,' and returns a number. Is this correct? Yes > Also, what > does 'forall' do? It declares or binds the name T. Like in logic, when we say "for all x, either x is true or x is false", the "for all" declares that x is the name we're talking about. > Does every deftype have to have a '->', No, you can declare any type, for example (deftype pi number) would be a declaration that goes with (define pi 3.14159) > and what does it do? The -> is a type constructor. It builds a procedure type in the same way that lambda builds a procedure. Or you can think of -> as the signal to the type checker's parser that "a procedure type is here". See the type notation web page from the course resources web page for details and several examples. You are interpreting the type of set-size correctly. > What about those with multiple arguments? A procedure type for a procedure with multiple arguments lists the types in order. For example the procedure (lambda (x y) (+ x y)) has type (-> (number number) number). Again see the type notation page available from the course resources web page http://www.cs.iastate.edu/~leavens/ComS342-EOPL2e/docs/typedscm_toc.html for details. Gary From leavens@cs.iastate.edu Sun Oct 7 11:21:56 2001 Date: Sun, 7 Oct 2001 11:21:48 -0500 (CDT) From: "Gary T. Leavens" To: dheck@iastate.edu CC: cs342s@cs.iastate.edu, leavens@cs.iastate.edu In-reply-to: <200110070655.BAA24976@isua5.iastate.edu> (message from Daniel J Heck on Sun, 07 Oct 2001 01:55:45 CDT) Subject: Re: Another Question Dan, > Now I am quite confused about the mechanics of the set ADT in problem > #7. Particularly, I am at a roadblock because I don't understand the > code for the set expression. If the syntax (set 1 2 3) is supposed to > result in the set containing 1, 2, and 3, how can it take the car in > the last line when 1 2 3 is a series of atoms and not a true list? I would > think that the correct expression would be (set '(1 2 3)). The procedure "set" takes any number of arguments and returns a set of them. Recall from lecture that the form of lambda with no parentheses around its argument (lambda args ; some code ) has the ability to make such procedures. They take 0 or more arguments, and the arguments are formed (by the Scheme system) into a list, which is bound to the formal parameter. The effect is that callers of the procedure pass it arguments one at a time, but in the code within the body, the formal parameter is a list of the arguments. For example, you can implement Scheme's built-in "list" procedure as (define list (lambda args args))) So we have: > (list 1 2 3) (1 2 3) > (list '(1 2 3)) ((1 2 3)) > (list ) () See the Revised^5 Report on Scheme on the course resources web page, and look in the section on lambda for more details. Gary From leavens@cs.iastate.edu Sun Oct 7 11:27:59 2001 Date: Sun, 7 Oct 2001 11:27:50 -0500 (CDT) From: "Gary T. Leavens" To: dheck@iastate.edu CC: cs342s@cs.iastate.edu, leavens@cs.iastate.edu In-reply-to: <200110070714.CAA08408@isua4.iastate.edu> (message from Daniel J Heck on Sun, 07 Oct 2001 02:14:45 CDT) Subject: Re: Third Time's a Charm! Dan, No problem, I'm glad to help. > Perhaps I haven't been paying close enough attention, but what is the > difference between a list and list-of? Perhaps the fact that the defrep > for problem 7 is defined in terms of list-of is what is leading to my > confusion. In the world of type expressions, there is no type constructor "list" only "list-of". Thus there is a type (list-of number), which is the type of a list like '(1 2 3), i.e. (list 1 2 3). In the world of Scheme executable expressions, you usually want to use "list" to build lists, such as (list 1 2 3), which has type (list-of number). You may want to stop reading now if you are understandings things... To complicate things further, we will see in chapter 2, that there is a procedure, list-of, which is executable, and can be used to make type predicates. This procedure takes a type predicate as an argument and returns one that tests for lists of whatever the predicate tests for. For example, (list-of number?) is a type predicate that returns true on objects that have type (list-of number). For example, ((list-of number?) (list 1 2 3)) ==> #t Again see the type notation web page available from the course resources web page for details. Gary From leavens@cs.iastate.edu Sun Oct 7 23:44:23 2001 Date: Sun, 7 Oct 2001 23:44:12 -0500 (CDT) From: "Gary T. Leavens" To: mnessen@iastate.edu CC: leavens@cs.iastate.edu In-reply-to: <5.1.0.14.2.20011007225810.00a6a988@mnessen.mail.iastate.edu> (message from Mark P Nessen on Sun, 07 Oct 2001 23:08:12 -0500) Subject: Re: 342 - # 11 typechecking Mark, > I am working on HW2, problem 11 and am running into some trouble. In the > problem statement, it says to copy "subst.scm" from $PUB/lib/ and that it > should type check. Well, I copied that file, ran scheme342typed, and tried > to load it, but I get the following errors: > > typed> (load "subst.scm") > Type checking "subst.scm" ... > Type checking "sym-exp.scm" ... > ... done type checking "sym-exp.scm" > subst.scm: lines 15 to 20: Expected type of variable and definition differ > Variable: subst > Type from deftype or uses : (-> (symbol symbol (list sym-exp)) (list > sym-exp)) > Type of defining expression: (forall (s t u) (-> (s t (list-of u)) > (list-of u))) > ... done type checking "subst.scm" > Skipping evaluation because of the type errors... > > I have not modified the file in any way, I just wanted to check it out > first before I started coding. Is there something wrong with the existing > code or is it the typechecker? Am I missing something? It says it type > checks but I can't get it to. Any help would be appreciated. The problem seems to be in the type checker. Fortunately, I'm logging in now in order to install a new version of the type checker, which fixes several bugs and has other improvements. I tried it on subst, and it works without problem. I'm not sure why the old version didn't work, but it may be related to another bug I fixed... > Also, could > you possibly explain how to use map? I can't find it in the books or on > any of the resources listed on the web page. Yes, the basic idea is that (map f (list x y z ...)) = (list (f x) (f y) (f z)) so, for example: (map odd (list 1 2 3)) = (list (odd 1) (odd 2) (odd 3)) = '(#t #f #t) (map odd '()) = (list) = '() It's easy to write it also (this is a simplification): (define map (lambda (f ls) (if (null? ls) '() (cons (f (car ls)) (map f (cdr ls)))))) The simplest type of map (this is the type of the above simplification) is (forall (S T) (-> ((-> (S) T) (list-of S)) (list-of T))) In words, for all types S and T, map takes a procedure of 1 argument (of type S) and a list (of elements of type S), and returns a list of the return type of the procedure. So (map odd (list 1 2 3)) has type (list-of boolean) Does that help? See also section 2.2.1 of Structure and Interpretation of Computer Progams, on the web at: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-15.html#%_idx_1666 Gary From leavens@cs.iastate.edu Mon Oct 8 08:53:32 2001 Date: Mon, 8 Oct 2001 08:53:26 -0500 (CDT) From: "Gary T. Leavens" To: mnessen@iastate.edu CC: leavens@cs.iastate.edu In-reply-to: <5.1.0.14.2.20011008000151.00a8b540@mnessen.mail.iastate.edu> (message from Mark P Nessen on Mon, 08 Oct 2001 00:08:03 -0500) Subject: Re: 342 - # 11, using map Mark, > Thanks, I understand it much better now. However, I'm having trouble > figuring out how to use it with subst-with-map. You say to only use it > once, and I thought i would use it with subst-sym-exp, but that's not right > and I can't figure out which procedure I would use it with. Because with > subst-sym-exp, you have to pass it 2 symbols and a sym-exp, but map uses > lists after the procedure. Am I making this more difficult than it really > is or am I just not seeing something obvious? If you can't help since you > might give away the answer, that's fine. Thanks for your help. I can give you a hint. You can use lambda or a curried procedure to make a procedure that takes one argument from a procedure that takes several arguments. Gary From - Tue Oct 9 03:56:00 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 DAA22100; Tue, 9 Oct 2001 03:48:49 -0500 (CDT) Message-ID: <3BC2B98D.E180B646@cs.iastate.edu> Date: Tue, 09 Oct 2001 03:47:09 -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: dongshin kim CC: Gary Leavens , George Ushakov , Facundo Bromberg Subject: Re: Question about hw2 References: <20011009080632.87693.qmail@web20503.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dong Shin, dongshin kim wrote: > In this homework, I am little confusing usage of > parse-sym-exp, and parse-s-list. > I used those procedure in my hw to make sure their > type check. > For instance, in 13, I used > ... > ([...] ([...] (parse-sym-exp (car slist))) > ([...] (parse-s-list (cdr slist))))))) > ... > In this case, do I have to write it omitting > parse-sym-exp, parse-s-list? Yes, you should not use the parse procedures in your solution. > What's the difference between using parse-sym-exp and > omitting parse-sym-exp? The difference is that the code is less efficient if you use the parsing procedures. Also, this trick won't work when the parser takes a string of characters, so that the data you're manipulating isn't of the parser's input type. Because of this, we'll take points off if you do this. > Anyway, my code is already passed out. > But sometimes, I saw something that has parse-sym-exp > to make sure and sometimes not. > Am I wrong? Yes, you should change your code to not use the parse procedures (except for checking test data input). -- 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 Wed Oct 10 14:45:20 2001 MIME-Version: 1.0 Date: Wed, 10 Oct 2001 14:44:15 -0500 From: "Gary T. Leavens" Organization: Department of Computer Science, Iowa State University X-Accept-Language: en To: Jon Nathan Vandis Subject: Re: HW2 number 17 Content-Type: text/plain; charset=us-ascii X-Status: X-Keywords: X-UID: 29 Jon, I have fixed this. Thanks for pointing it out to me. Jon Nathan Vandis wrote: > I've just finished number 17, and I believe there is an error in the > deftype for vector-index in the assignment. There should be another ) at > the end. Not a big deal, but I thought I'd let you know. > > -Jon -- 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 Wed Oct 10 14:54:36 2001 MIME-Version: 1.0 Date: Wed, 10 Oct 2001 14:53:34 -0500 From: "Gary T. Leavens" Organization: Department of Computer Science, Iowa State University X-Accept-Language: en To: Daniel J Heck Subject: Re: Insights! Content-Type: text/plain; charset=us-ascii X-Status: X-Keywords: X-UID: 31 Dan, > > I am starting to realize that maybe it's not quite as simple as just > putting cars and cdrs wherever I want any more. I'm guessing that these > commands don't necessarily return the desired datatype (e.g. symbol or > list, rather than sym-exp), and that this is causing the problems I > discussed in the earlier e-mail. > > Is this an accurate conclusion? Yes, although when working with lists of sym-exps, car and cdr give the right types, when working with individual sym-exps, you have to use the helping procedures to get the right type information so that it can be type-checked. -- 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