Question caches in general 

Forum: Com Sci 12500, U Chicago, Autumn 2002, Discuss Classwork
Date: 2002, Nov 30
From: Katie Edmonds <katie@uchicago.edu>

Could someone explain why new-withdraw stops working properly when given an argument:

(define (new-withdraw n)
  (let ((balance 100))
    (lambda (amount)
      (if (>= balance amount)
	  (begin (set! balance (- balance amount))
		 balance)
	  ("insufficient funds")))))

((new-withdraw 9) 10)
;Value: 90

((new-withdraw 9) 10)
;Value: 90


Messages

1. Feedback It is working properly by Mark Kittisopikul, 2002, Nov 30
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
... 4 Message(s)
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
...

to: "caches in general"