Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site mako.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxj!houxm!vax135!cornell!uw-beaver!tektronix!orca!mako!jans From: jans@mako.UUCP (Jan Steinman) Newsgroups: net.lang Subject: Re: levelheight: automatic "nil pointer" handling Message-ID: <536@mako.UUCP> Date: Thu, 24-Jan-85 13:01:44 EST Article-I.D.: mako.536 Posted: Thu Jan 24 13:01:44 1985 Date-Received: Fri, 25-Jan-85 21:56:47 EST References: <2340@hplabsc.UUCP> <4948@utzoo.UUCP> <6292@boring.UUCP> Reply-To: jans@mako.UUCP (Jan Steinman) Distribution: net Organization: Tektronix, Wilsonville OR Lines: 30 In article <6292@boring.UUCP> steven@boring.UUCP (Steven Pemberton) writes: >I believe that programming languages can go much further in the help they >give programmers than they do at present. For instance, it is possible to >statically guarantee that nil pointers are never dereferenced (imagine the >bugs that that would prevent!) but I know of no language that supports it. Ada supports this: |Not only can we explicitly create objects designated by access values, but we |can also destroy them. Such objects will no longer be accessible if all |references to them are removed, such as: | | MY_PACKET := new BUFFER; -- a BUFFER object is created | MY_PACKET := null; -- the original object is unreachable | |Furthermore, these dynamic objects will be destroyed once we leave the scope |of the access objects. For example: | | declare | POINTER : BUFFER_POINTER; | begin | ... | POINTER := new BUFFER; -- create a BUFFER object | ... | end; -- BUFFER object is destroyed From "Software Engineering With Ada", Grady Booch, p.105. -- :::::: Jan Steinman Box 1000, MS 61-161 (w)503/685-2843 :::::: :::::: tektronix!tekecs!jans Wilsonville, OR 97070 (h)503/657-7703 ::::::