Path: utzoo!mnetor!uunet!mfci!yale!krulwich-bruce From: krulwich-bruce@CS.YALE.EDU (Bruce Krulwich) Newsgroups: comp.lang.lisp Subject: Re: query 'bout defstruct (Common LISP) Message-ID: <28800@yale-celray.yale.UUCP> Date: 10 May 88 16:36:04 GMT References: <10834@cgl.ucsf.EDU> <5190@bcsaic.UUCP> Sender: root@yale.UUCP Reply-To: krulwich-bruce@CS.YALE.EDU (Bruce Krulwich) Organization: Yale University Computer Science Dept, New Haven CT 06520-2158 Lines: 28 Keywords: defstruct, symbols, confusion In article <10834@cgl.ucsf.EDU> yee@cgl.ucsf.edu (dave yee) writes: >... Now for the tricky part. I will have a variable number of >"pieces" at any given time in the program. So i would like the >computer to generate new symbols for me. The new symbols would then >be used as names for the new pieces. I have to ask: Why would you ever want to do this?? If you're going to have a variable number of pieces then you'll want to store them in a list or table anyway. Why bother GENing symbols?? In article <5190@bcsaic.UUCP> lbaum@bcsaic.UUCP (Larry Baum) writes: >However, while this will successfully do the binding, it will defeat >your goal of having a name for your object, since the symbol returned >by (gentemp) has been lost. Better would be: > >(let ((symb (gentemp))) > (set symb (make-piece)) > ... code to get a handle on symb ...) Why?? What does this buy you over simply (let ((piece (make-piece))) ...) The only reason I can see this being a way to do things is if you're making piece structures at macro-expand time, which seems gross. Is there another reason?? Bruce Krulwich