Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond!diamond From: diamond@diamond.csl.sony.junet (Norman Diamond) Newsgroups: comp.lang.pascal Subject: Re: Pointers.. Message-ID: <10331@socslgw.csl.sony.JUNET> Date: 5 Jun 89 05:20:05 GMT References: <3398@westfort.UUCP> <8835@phoenix.Princeton.EDU> <16969@swrinde.nde.swri.edu> <1150@draken.nada.kth.se> Sender: news@csl.sony.JUNET Reply-To: diamond@csl.sony.junet (Norman Diamond) Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 30 In article <1150@draken.nada.kth.se> d87-jse@nada.kth.se (Joakim Sernbrant) writes: >Talking about pointers, is there any reason why I shouldn't do this on >a PC running DOS without multitasking: > >while p <> nil do begin > dispose(p); > p := p^.next; >end; > >??? If you don't care what bugs you incorporate into your programs, for which you might spend days later debugging (e.g. when you get the next release of a compiler, or that multitasking OS, etc.), then of course you can play however you like. If you're working for someone like me then you don't want to do it, at least not deliberately, because you'd get fired. Also there is a chance that some kindly compiler might help you find your bugs, perhaps by setting p to NIL when the dispose is done. And some other kindly compiler might do garbage collection for you, which renders ordinary pointers a little bit more expensive to use but which does have some demand in quite a lot of languages now. -- Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.co.jp@relay.cs.net) The above opinions are my own. | Why are programmers criticized for If they're also your opinions, | re-implementing the wheel, when car you're infringing my copyright. | manufacturers are praised for it?