In my program that I am writing I have some parameters like for example the followings :
(defparameter foo 3)
and then after that down in my code I have another parameter that has a value that depends on the previous one :
(defparameter bar (+ 2 foo))
When I evaluate the code in this example i get foo that equals 3 and bar that equals 5.
Since I am new in Common Lisp, and new in programming in general, I was expecting that by updating the value of foo, for example by doing (setf foo 6), I would have had the value of bar also automatically updated to 8.
But this is not the case. If I update foo to 6 although the definition of bar is (+ 2 foo) if I call bar I still get its initially evaluated value of 5.
How do I get to have variables that update themselves instantaneously every time another variable to which they are dependent gets modified?