basic question about define and set!
Posted: Mon Mar 08, 2010 4:39 am
Hello,
Suppose I want to store a value for later use. I define it using:
(define balance 10)
Later on I apply a function to #'balance and want to store the result for later use. The old value of #'balance is useless, and I do not want to introduce a new name every time for the result of function application, so I do either one of the followings. I would like to ask what is the real difference between the followings:
(define balance (some-function balance))
vs
(set! balance (some-function balance))
Thanks.
Suppose I want to store a value for later use. I define it using:
(define balance 10)
Later on I apply a function to #'balance and want to store the result for later use. The old value of #'balance is useless, and I do not want to introduce a new name every time for the result of function application, so I do either one of the followings. I would like to ask what is the real difference between the followings:
(define balance (some-function balance))
vs
(set! balance (some-function balance))
Thanks.