Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!ncar!news.miami.edu!umiami!gv9b2c9z From: gv9b2c9z@umiami.ir.miami.edu (Ordinary Man) Newsgroups: comp.sys.mac.programmer Subject: Double dereferenced handles Message-ID: <1991Jan30.215459.7730@umiami.ir.miami.edu> Date: 31 Jan 91 02:54:59 GMT Organization: Univ of Miami IR Lines: 48 Is it bad programming practice to double dereference a handle to a record (with linked lists in mind)? Is there a better way to do it without sacrificing a lot of time spent implementing it? I've tried linked lists both ways (with all pointers and with all handles). Right now I'm implementing it with all handles. I don't notice any speed difference that's significant so is it better to derefernce the handle twice or to set it to a pointer and then use that pointer? Let me illustrate: type listHand=^listPtr; listPtr=^list; list=record item:whatever; next:listHand; end; var theList:listHand; temp:listPtr; Do I say this: HLock(Handle(theList)); temp:=theList^; temp^.item:=whatever; ... or this: HLock(Handle(theList)); theList^^.item:=whatever; ... Or does it matter? Thanks in advance, ==Dan -- /-------------------------------------------------------------------------\ | Dan Weisman - University of Miami - Florida | || || || || | |--------------------------------------------------| || || ||\ /|| | | INTERNET -----> gv9b2c9z@umiami.IR.Miami.edu | || || || | || | | BITNET -----> gv9b2c9z@umiami | ||||||| || | || | |-------------------------------------------------------------------------| | "...bows it's head and prays to the mother of all machines." | \_________________________________________________________________________/