The deliverables requests ``observations about the rules and definitions for procedures". This is an error and should be ignored.
Question 5 in After the Lab should read "...(and are avoided in fast-fib) ..." and not "...(and are avoided in fib)..." as it currently does.
> (time->12string breakfast) "7:30:00 am"but it should have
> (time->12string breakfast) "07:30:00 am"The hour should take two digits.
There is only one string input procedure: string->time, but it requires several helpers.
(define joel
(lambda (x y)
(letrec
((help
(lambda (a b c)
(if (> a b) a (help (* c a) b))))))
(help x y 2)))
This is buggy. The following is better:
(define joel
(lambda (x y)
(letrec
((help
(lambda (a b c)
(if (> a b) a (help (* c a) b c)))))
(help x y 2))))
The lab mentions the square root procedure in the Deliverables. There is no need to write a square root procedure.
In Checkpoint question 2, instead of having the helper count up from 0, it is easier if factorial checks for n being 0 and then calls the helper to count up from 1.
Checkpoint part 3: cube-root *doesn't* have to check whether its argument is positive or negative, whereas fourth-root does.
(define house
(lambda (dr mv)
...
Well, it should be (lambda (mv dr) ...
if you want it to be consistent with the other graphical procs in the lab.
The lab will probably be amended to say in the random-picture command: {number} is the number of commands in the picture. It outputs a random picture with a MAXIMUM of number commands
> (define ice-cream-bar
(make-meltable-thing 'ice-cream-bar 2)
The lab neglects to show that (clock) returns ().
In the late homework question, to find out how to get jim to have the homework, without getting you upset, you must read the person class to find out how to change the objects owned by a person.
?? (current-position) pizzeria ?? (look-around) == ok ?? (look-around) luigi says -- Your pizza is available for pickup. ?? (look-around) pizza == okThe commands are not enclosed in parentheses in the text.
The text shows the person with the pizza groveling. This is unnecessary since the person can give the pizza. The person should offer the pizza, lose it, and return it as the value of the grovel message. Then the troll can take the pizza, which removes it from the place. The dialog should be:
grendel moved from lair to clock-tower. grendel says -- Hssss--s! I'm going to eat you, tommy!! grendel says -- Grovel, you low-on-the-food-chain human! tommy says -- Take this pizza instead, please! grendel took pizza grendel says -- OK, thanks for not putting any anchovies on it!The text mentions computer-lab, which should be cs-lab to agree with the "Adventures in Objectland" lab.
The examples use the word ``dungeon" while the text uses the word ``lair" to refer to the troll's quarters. The ``Deanery" mentioned in the lab is the same as the Dean's office.
The class cl-host has a method account that returns a cl-account object.
The class cl-account has a method id that returns the user id of the user currently logged in.
The class cl-wrapper transmits name to the file-server object rather than block the message.
After the host is created, it must be initialized:
(define host1 (cl-host 'make 'host1 fs1)) (host1 'init host1)In cl-account, the method files does not return a list of file objects, as the documentation claims, but rather an association list where the car of each pair the name of the file and the cdr is the file object itself.
File servers must also be initialized:
(define fs1 (cl-file-server 'make ...)) (fs1 `init fs1)
In deliver-mail
((cdr (assv from-server (box-alist-ref file-servers)))
'sendmail email))
should be
((cdr to-server) 'sendmail email))
In cl-host, the wrapper method should be:
((wrapper)
(if (not account)
(error (list name message) "No user at the moment")
(let ((name (car args))
(wrapper (env 'get-variable 'wrapper)))
(if (eqv? 'run name)
(apply wrapper (cons (car args) (cons env (cdr args))))
(apply wrapper args)))))))
In this way, public programs on the host will cause the wrapper to receive
a run message, like run, and will not be confused with services like
sendmail.
(cons (car alist) (remove-alist-help (cdr alist) key))))))
In the ftp question, you don't have to alter the procedure do-ftp. Just
provide the services it needs.
(define-class meter (constructor proc)should be
(define-class meter (constructor-arguments proc)In the signature for number-of-comparisons, the third element in the inputs should be "compare is a comparison procedure".
The student will have to write make-sorted-list, and generate-sorted-lists, and generate-random-lists. These are not described in the Deliverables but are part of the work and should be handed in.
The lab never tells the student that the formula can contain operations, forms, as well as the name of formulas. The solution presented here uses a translate procedure to produce a formula with no references to any defined symbols. It is based on deep-map from Chapter 4 (in the text) as a starting point. The lab doesn't tell students about it.