If I want to send a function as a parameter to another function, what should I do ?
For example I have
(defun (run (test))
(print test))
(run 'test)
"test" is a function here and I want to send this function to the "run" function.
(defun foo (a b) (format t "a + b = ~s~&" (+ a b)))
(funcall #'foo 2 3)
(apply #'foo '(2 3))Imagine that "a" (the parameter in foo function) is a function. Then what will happen ? Is it possible to send it like the above code ?
This code is correct ?
(let ((result '(0 5 (b) 0 0)))
(dotimes (i 3 result)
(setq result (funcall _step result)))(princ #(1 2 3)) ; prints the array #(1 2 3)
(princ (aref #(1 2 3) 1)) ; prints the second member of the array, i.e. 2Users browsing this forum: No registered users and 3 guests