setf and cons

Started by tomtoo, February 20, 2010, 06:23:51 AM

Previous topic - Next topic

tomtoo

Hey guys,



given this:

(define (c cc)(setf (eval (cc 0)) (cons (cc 1) '())))

I get this:

ERR: no symbol reference found

I see in the manual that this is normal, but I'd like to find an alternative way of making

("this" "that")

into something that results from something like

(set 'this "that")

let me know if I haven't provided enough info.  it's a bad habit...:-)

Lutz

#1
Do you mean this?


(define (c cc)
(set (sym (cc 0)) (cons (cc 1) '())))

(c '("this" "that")) => ("that")

; the symbol 'this' is now set to ("that")

this => ("that")

tomtoo

#2
Yep, I think so, thanks. I think it was "sym" that I was missing.



 I need to memorize all the functions, I guess, because when I need them I either can't remember them or can't find them.