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