Nomiz,
Your formatting suggests you're trying to apply a C-style solution in lisp, which
can be done, but isn't such a good idea. When on ice, you're better off with skates

Rather than try to debug what may be a valiant struggle in the wrong direction, what problem are you actually trying to solve here?
In case it's helpful, it's considered bad form for a function to change the value of variables that it's given as arguments. It may also to remember that you
don't need to create intermediate variables to hold the results of calculations - instead, you can operate directory on the value returned by a function call.
So, instead of creating a variable
x, passing it to a function that assigns it a random value, and then passing it to another function that multiplies it by a suitable factor (say, 5), and then passing it on to yet another function that prints out the result, in CL you'd do something more like this:
Code: Select all
(defvar foo ()
(format t "~A" (* 5 (random 10))))
- you print out the result of multiplying 5 by the result of calling (random) with an argument of 10.