Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!rutgers!mcnc!rti!xyzzy!yoyodyne.rtp.dg.com!langley From: langley@yoyodyne.rtp.dg.com Newsgroups: comp.lang.eiffel Subject: What happens when you're gone and forgotten? Message-ID: <1586@xyzzy.UUCP> Date: 19 Mar 90 12:33:33 GMT Sender: usenet@xyzzy.UUCP Reply-To: langley@yoyodyne.rtp.dg.com () Organization: Data General Corporation, Research Triangle Park, NC Lines: 21 How do I write a class so that a routine will get called every time the object is forgotten? In particular, whenever the object becomes unreachable, or is subjected to an explict forget operation, I want a class routine to get called. Stated another way, if I have a function that is called whenever something is created, it seems like I should have a function called when it is deleted too. Alternatively, if creation is implicit then destruction should be implicit too. Being allowed an explicit constructor, but no destructor, seems inconsistent. People who have used C++ will know what I am talking about when I ask "how do you define a destructor?" Is it the case that for some reason this sort of functionality isn't useful in Eiffel? It seems to me that even in a GC-ed environment I might like to have some way of keeping references to my own objects... Mark Langley langley@dg-rtp.dg.com