This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
(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)
(define (g x) x)
(define (f data) (g data))
(f '(+ 1 2)) ;; -> (+ 1 2) The list is not evaled.
(setq a '(a1 a2))
(dolist (x a)
(let (z $idx)
(setq x (lambda(y) z))
))
;; sum accumulator
(define (sum (x 0)) (inc 0 x))
(sum 1) → 1
(sum 2) → 3
(sum 100) → 103
(sum) → 103
sum → (lambda ((x 0)) (inc 103 x))
(setq var "b")
(apply append '("a" var)) ;; I believe the result will be "ab", but what I get is error message.
(setq var "b")
(append "a" var);; -> "ab"