Xref: utzoo comp.lang.misc:1234 comp.lang.modula2:699 Path: utzoo!mnetor!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.misc,comp.lang.modula2 Subject: Garbage collection Message-ID: <2849@enea.se> Date: 15 Mar 88 08:51:15 GMT References: <272@fang.ATT.COM> Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.lang.misc Organization: ENEA DATA AB, Sweden Lines: 28 Edmund E Howland (cbseeh@fang.ATT.COM) writes: >Huh? >Since when have these three ever had a need for garbage collection? >I am not too familiar with Ada, but garbage collection exists in >languages for whom dynamic binding is a way of life, not an option. If I define and implement a package for a data type of some sort in Ada I can hide the implementation of the type, just providing a set of operations. At a later state I can change the implementation without affecting the interface. However, I must already in the first step, decide whether objects of this type should be dynamic or not. Not so much for a allocation routine, you quite often need an initiation routine, anyway. But do I need a deallocation routine? If there is garbage collection, I don't have to think of this problem. Yes, I can one there just in case, but then the calling units have to bother about using them, which may require a lot of clean-up code, which might be totally unnecessary. Generally, garbage collection is a must in object-oriented programming. (No, I don't belive Ada is a true OO-language.) -- Erland Sommarskog ENEA Data, Stockholm sommar@enea.UUCP "Si tu crois l'amour tabou... Regarde bien, les yeux d'un fou!!!" -- Ange