Updates
- 9/30 One error case which you do not have to check for is that the getters get the correct number of arguments. You are allowed to assume that when the user calls one of the getters that he always provides exactly one argument. However, you should still check that that argument if of the correct type.
- 9/28 Fixed a bug related to printing "dotted pairs" in the oracle. To clarify, the following is a valid sequence of commands you should be able to handle:
>(cons 1 2)
(1 . 2)
>(defstruct point x y)
point
>(cons 1 (make-point 1 2))
(1 . #s(point x 1 y 2))
- 9/27 Two files, test.ok.in and test.error.in, have been provided for your use. These contain all of the test cases which have been put on this website. To make best use of these files you should do the following at the unix prompt (the case for test.error.in is similar):
% proj1oracale.nova < test.ok.in > oracle.ok.out
% myproj1 < test.ok.in > my.ok.out
% diff my.ok.out oracle.ok.out
This will automatically test your output against the oracle's for these test cases (no output from running the diff command means that your output matched). Note that passing these tests does not guarantee you will pass the autograder.
- 9/27 An "extra for experts" section has been added to the project spec. This is for fun only and not worth any extra credit.
- 9/26 The only error conditions you are required to handle are the ones listed in the origonal project spec plus the stuff relating to redefining structs (see below). Though other errors exist you don't have to check for them, and we won't be testing them.
- 9/26 Yet another bug in the oracle has been fixed.
- 9/26 Don't worry about what happens when a struct is defined which has a bizzare name. We won't test this. You can assume that we won't define structs whose names have keywords or hyphens or some other stuff which might screw your code up in them. Some examples of what we won't do:
>(defstruct make a b c)
>(defstruct foo-bar a b)
>(defstruct cons a b)
>(defstruct foo a-b c)
- 9/26 A new version of the oracle is available. If you discover a bug please notify Steven either via the newsgroup or by emailing him directly.
- 9/25 Further clarification on redefining structs. Only one struct of a given name can be defined at once. When you define a struct with the same name as a previous one, the new definition should completely overwrite the old. Example:
>(defstuct student sid gpa)
student
>(defstruct student name major)
student
>(make-student 'donny 'eecs)
#s(student name donny major eecs)
>(student-sid (make-student 'donny 'eecs))
Unknown function
()
>(defstruct student name)
student
>(make-student 'donny 'eecs)
Error: incorrect number of arguments
()
>(make-student 'donny)
#s(student name donny)
Note that the oracle doesn't quite handle this correctly as of now, but Steven won't have a chance to fix it until Sunday morning. Also don't worry about the case where someone attempts to redefine a struct but there is an error in the new definition.
- 9/24 Two slight bugs relating to error handling in the oracle has been fixed.
- 9/24 The oracle has been written. It is compiled to run on nova.cs.berkeley.edu. Before running it you may have to type chmod 700 proj1oracle.nova at the unix prompt. Please report any bugs or questionable behavior to Steven.
- 9/24 Some of you noticed that when you type in an expression to the interpreter we gave you it allocates memory but never frees it. You do not have to fix this, and you are allowed to be similarly sloppy with the code you add.
- 9/23 Since a struct with no fields is pretty useless and it may make some of your code easier, you are allowed to assume that all structs are defined to have at least one field. That is, a statement like (defstruct wierd) will never be given to you. You do not need to treat this as an error case though.
- 9/23 Some minor typos in the example program run under the error handling section were fixed.
- 9/23 Steven told some of you that part 3 might end up being optional. This is not the case. Parts 1, 2 and 3 are all required.
- 9/23 If you redefine a structure then the new definition should replace the old one. For instance the following sequence of commands is legal:
>(defstruct person name age)
person
>(defstruct person name haircolor)
person
and the new definition of person should be used.
- 9/23 You should add all your code into lisp.c. The command gcc lisp.c should completely compile your project with no errors or warnings.
- 9/23 Description of which error cases to look for as well as how to handle them has been added.
- 9/22 For those of you who are unfamiliar with Scheme/Lisp, Steven will be holding an additional office hour Thursday the 23rd at 12pm in the second floor lab where you can come to ask him questions.
- 9/22 Hopefully Steven will be able to get an "Oracle" up within a day or two.
- 9/22 Also within a day or two Steven hopes to update the spec with how you should handle various error cases