Code Select
(define (g (x y)) x)
(define (f data)
(setf (nth '(0 0 1) g) data)
)
;;test:
(f 1)
(g) ;; -> 1 Right. This is what I want.
(g) ;; -> 1 Right. This is what I want.
(f '(+ 1 2))
(g) ;; -> 3 This is not what I want. I can't understand why the quoted list '(+ 1 2) is evaluated?. I just want to get the list itself '(+ 1 2)
By contrast,
Code Select
(define (g x) x)
(define (f data) (g data))
(f '(+ 1 2)) ;; -> (+ 1 2) The list is not evaled.
Is there a better way to prevent this kind of unwanted eval during the parameter transfer?