Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!news-e2a.gnn.com!howland.erols.net!torn!watserv3.uwaterloo.ca!kmayall
From: kmayall@cousteau.uwaterloo.ca (Kevin Mayall)
Subject: Garbage collection and CLOS
Message-ID: <DyyvMr.5uw@watserv3.uwaterloo.ca>
Sender: news@watserv3.uwaterloo.ca
Nntp-Posting-Host: cousteau.uwaterloo.ca
Organization: University of Waterloo
Date: Tue, 8 Oct 1996 17:08:51 GMT
Lines: 37

Hello - I wanted to see if I understand garbage collection correctly in
regards to CLOS objects. Let's say the method foo takes a Line object, and
the method bar takes two Point objects, and I want to use bar in foo.  In
the following code, will the two Point instances be removed by the garbage
collection because they aren't bound to a symbol? 

(defmethod first-func ((line Line))
   (second-func
    (make-instance 'Point
      :coords (x (first-vertex line))
              (y (first-vertex line)))
    (make-instance 'Point 
      :coords (x (last-vertex line))
              (y (last-vertex line)))))

(defmethod second-func ((point1 Point) (point2 Point))
   ; etc., etc.)


Disclaimer: This is not a class assignment.  I am a non-CS grad student 
learning CL for my dissertation work.

Cheers...........

	Kevin


--------------------------------Bermuda Massive
Kevin Mayall               kmayall@uwaterloo.ca
         http://www.fes.uwaterloo.ca/u/kmayall/
     School of Planning, University of Waterloo

-- 
--------------------------------Bermuda Massive
Kevin Mayall               kmayall@uwaterloo.ca
         http://www.fes.uwaterloo.ca/u/kmayall/
     School of Planning, University of Waterloo
