Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!cvl!elsie!nih-csl!keith From: keith@nih-csl.UUCP (keith gorlen) Newsgroups: comp.lang.c++ Subject: Re: null news is bad news Message-ID: <293@nih-csl.UUCP> Date: 28 Dec 87 15:41:54 GMT References: <185@goofy.megatest.UUCP> <191@fxgrp.UUCP> Organization: NIH-CSL, Bethesda, MD Lines: 27 Summary: The real solution is to wait until C++ has exception handling In article <191@fxgrp.UUCP>, ljz@fxgrp.UUCP (Lloyd Zusman, Master Byte Software) writes: > In article <185@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes: $ $ $ $ $ $In THE BOOK, on page 93, it says, "For historical reasons, *new* simply $ $returns the pointer 0 when it cannot find enough store and no *_new_handler* $ $has been specified." $ $ ... $ $Can anyone give me a good reason why I should not hack *new* so that $ $it prints an error message and terminates the program when core is $ $exhausted and there is no *_new_handler*? Is there, or is there $ $likely to be, code out there which DEPENDS on *new* returning 0? $ $ ... $ $ Please, please, please ... I beg of you, PLEASE don't do that. $ I agree. This sort of problem currently has no good solution in C++ (or in C for that matter). What is needed is an exception handling mechanism like that of BLISS or ADA. Bjarne discusses this issue in his paper "Possible Directions for C++", which is to be published soon in the Proceedings of the First USENIX C++ Workshop. -- Keith Gorlen phone: (301) 496-5363 Building 12A, Room 2017 uucp: uunet!mimsy!elsie!nih-csl!keith National Institutes of Health Bethesda, MD 20892