Path: utzoo!mnetor!uunet!husc6!bbn!rochester!udel!princeton!mind!eliot From: eliot@mind.UUCP (Eliot Handelman) Newsgroups: comp.lang.lisp Subject: Re: query 'bout defstruct (Common LISP) Message-ID: <2408@mind.UUCP> Date: 3 May 88 01:35:05 GMT References: <10834@cgl.ucsf.EDU] <786@hydra.riacs.edu> Reply-To: eliot@mind.UUCP (Eliot Handelman) Organization: Bad Sounding Music, Inc Lines: 29 Keywords: setf, gentemp, clarity In article <786@hydra.riacs.edu] nienart@turing.arc.nasa.gov.UUCP (john nienart) writes: ]In article <10834@cgl.ucsf.EDU> yee@cgl.ucsf.edu (dave yee) writes: ]> ]>Now, i figured i could use "gentemp" to make the symbols, ]>but i can't "setq" these new symbols (i.e. ]>(setq (gentemp) (make-piece)) just doesn't cut it... ]> ]How about (setf (symbol-value (gentemp)) (make-piece))? This gets the ]effect you want. However, you don't have a handle on the name after ]this, so you probably want something like: ] ](let ((sym (gentemp))) ] (setf (symbol-value sym) (make-piece)) ] ...) ]which gives SYM a value which is the name of your piece. Symbol-value can ]access it then. Why not just use (set (gentemp) (make-piece))? It does the same thing without bothering to hunt down the setf method. If you need the handle you can either use LET or have the new name returned as a second value: (defun set-gentemp (form) (let ((sym (gentemp))) (values (set sym form) sym))) Best wishes, Eliot Handelman