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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5ecb5248e650e812 X-Google-Attributes: gid103376,public From: Huy Vo Subject: Re: Ada and robots Date: 1997/06/26 Message-ID: <9706262213.AA13647@stealth.ctron.com>#1/1 X-Deja-AN: 252853795 Sender: Ada programming language Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada Date: 1997-06-26T00:00:00+00:00 List-Id: jsa@alexandria.organon.com (Jon S Anthony) wrote: >In article <9706242128.AA09652@stealth.ctron.com> Huy Vo writes: > >> >a) No one is dumb enough to suggest Ada programs are by nature some >> >how bug free. So, you are just giving a silly strawman >> >> Cool; Ada is not as safe as I thought it was; so, when I board a Boeing >> I should think twice. > >Whatever floats your boat. > > >> As a C programmer, I know it better than anyone; so I have been >> religiously checking every malloc()'s return and proceed >> accordingly. What do you do when you call new and new fails? > >Whatever is appropriate. > >> You rely on the runtime system telling you what line it fails? > >No. All such stuff should be isolated with a non-lowlevel interface. >Inside the implementation exception handler(s) take the appropriate >action. Outside, no one cares or needs to care. Someone has to care, Jon. Because if you dynamically allocate memory at 101 places in your 100K lines of code and only one of the allocations failed, you really want to know which one failed. As an application programmer what would you do? As a compiler writer that has to provide a default handler for this type of situation what would you do? In C, it's as simple as if (!(cp =malloc(BIG_CHUNK)) { fprintf(stderr, "Buy some more ram, i died at line %d\n", __LINE__); exit(1); } Show me your code.