From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: johnherro@aol.com (John Herro) Subject: Re: Why no Free? Date: 1996/10/18 Message-ID: <54875p$cj6@newsbf02.news.aol.com>#1/1 X-Deja-AN: 190318840 sender: root@newsbf02.news.aol.com references: organization: America Online, Inc. (1-800-827-6364) newsgroups: comp.lang.ada Date: 1996-10-18T00:00:00+00:00 List-Id: In article , mheaney@ni.net (Matthew Heaney) writes: > If I can do this > The_Node : Node_Access := new Node; > then why shouldn't I be able to do this > Free (The_Node); > without instantiating Unchecked_Deallocation? ... > To the designers of Ada 95: Why didn't you throw > in a Free? I'm not a designer of Ada 95, but I think I know the answer: because it would be dangerous! You could write The_Node : Node_Access := new Node; Copy : Node_Access := The_Node; Free (The_Node); and then dereferencing Copy will have unpredictible results. By forcing you to instantiate Unchecked_Deallocation, the language designers are at least making sure that you, the programmer, know that you're doing something dangerous. - John Herro Software Innovations Technology http://members.aol.com/AdaTutor ftp://members.aol.com/AdaTutor The mathematical relationship between Christmas and Halloween: 25 = 31 DEC OCT