Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!ncar!zaphod.mps.ohio-state.edu!ceres.physics.uiowa.edu!news.iastate.edu!sharkey!umich!umeecs!msi.umn.edu!cs.umn.edu!kksys!edgar!mmug!p510.f22.n282.z1.mmug.edgar.mn.org!Jim.Spencer From: Jim.Spencer@p510.f22.n282.z1.mmug.edgar.mn.org (Jim Spencer) Newsgroups: comp.sys.mac.programmer Subject: Re: Another THINK Pascal gotcha - "With" instance vars Message-ID: <1.27ACFB10@mmug.edgar.mn.org> Date: 4 Feb 91 05:29:17 GMT Sender: ufgate@mmug.edgar.mn.org (newsout1.26) Organization: FidoNet node 1:282/22.510 - SmorgasBoard UUCP, Twin Cities, MN USA Lines: 18 Lawson English writes in a message to All KR> myPtr := myHandle^; myValue := myPtr^; KR> You don't have to worry about anything - including drivers - KR> moving memory in between those two statements. LE> Correction: you SHOULDN'T have to worry about anything moving LE> memory between those two statements. Remember to drive defensively... Huh? I don't profess to have anywhere near the knowledge of Keith but it sure looks to me like his statement is correct and the programmer shouldn't have to lose a moments sleep over this. I don't even start to understand why you won't want to waste time "driving defensively" in this situation. Locking and unlocking myHandle in this circumstance goes beyond careful: its downright wasteful. If you are automatically, without thinking locking everything down before you dereference it, you are simply wasting both your customers' and your time. This may not be as bad as the guy here who said he never locked his handles down but its not good practice. -- Jim Spencer - via The Minnesota Macintosh Users Group UUCP-Fido Gateway UUCP: ...uunet!tcnet!kksys!edgar!mmug!22.510!Jim.Spencer INET: Jim.Spencer@p510.f22.n282.z1.mmug.edgar.mn.org