Is it possible to structure lists of functions and then call those functions from the list with a function like nth or assoc? Take the following:
I want this to return me 10 random values between 0 and 4. Instead i get the first value random comes up with 10 times. This is obviously because the variable functions* is being set as a one element list, the output of the random function, and i am then just calling the value held by the variable and not the function itself. Is there a way to store a function so that it is not evaluated until you call it with something like nth?
BIOS
(let* ((functions*
(list (random 5))))
(loop for i below 10 do
(print (nth 0 functions*))))
I want this to return me 10 random values between 0 and 4. Instead i get the first value random comes up with 10 times. This is obviously because the variable functions* is being set as a one element list, the output of the random function, and i am then just calling the value held by the variable and not the function itself. Is there a way to store a function so that it is not evaluated until you call it with something like nth?
BIOS