Feedback It is working properly 

Forum: Com Sci 12500, U Chicago, Autumn 2002, Discuss Classwork
Re: Question caches in general (Katie Edmonds)
Date: 2002, Nov 30
From: Mark Kittisopikul <markkitt@uchicago.edu>

Katie, It is working properly, it's just not doing what you think it is doing.

Everytime you call new-withdraw it creates another "bank account". Your commands created a bank account and withdrew 10 from that account, then created another bank account and withdrew 10 from that. What you want to do is this:

;Create a bank account and call it myaccount
(define myaccount (new-withdraw 9))
;Value: myaccount

;Withdraw 10 from myaccount
(myaccount 10)
;Value: 90

;Withdraw another 10 from myaccount
(myaccount 10)
;Value: 80


Messages

1. Question what are we really trying to do anyway? by Katie Edmonds, 2002, Nov 30
1. Feedback The key point about your new-withdraw is that the parameter is never used in the body by Mike O'Donnell, 2002, Nov 30
(_ Question Untitled by Katie Edmonds, 2002, Nov 30
(_ Feedback (lambda (x) (let ...)) vs. (let (...) (lambda (x) ...)) by Mike O'Donnell, 2002, Nov 30
(_ Question don't u mean n when u're talking about var binding??? by Ivan Beschastnikh, 2002, Dec 09
(_ Agree I mistyped "m" for "n" by Mike O'Donnell, 2002, Dec 09
2. Question the question by Katie Edmonds, 2002, Nov 30
1. Feedback No serious difference in treatment of 0 argument functions by Mike O'Donnell, 2002, Nov 30
(_ Question So new-withdraw isn't a function by Katie Edmonds, 2002, Nov 30
(_ Feedback new-withdraw in the text is a procedure, but does not return a procedure by Mike O'Donnell, 2002, Nov 30

to: "It is working properly"