Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!nic.MR.NET!shamash!tank!uwvax!shorty!engber From: engber@shorty.CS.WISC.EDU (Mike Engber) Newsgroups: comp.sys.mac.programmer Subject: Object Pascal Summary: the with statement - is it safe? Keywords: Object Pascal Message-ID: <7096@spool.cs.wisc.edu> Date: 27 Jan 89 01:36:13 GMT Sender: news@spool.cs.wisc.edu Reply-To: engber@shorty.cs.wisc.edu (Mike Engber) Organization: U of Wisconsin CS Dept Lines: 26 In the December '86 issue of MacTutor (also Apple Tech Report #6) Ken Doyle wrote an articl on object Pascal in which he warns that using the with statement on objects is dangerous in the same way using a with statement on an unlocked handle is dangerous. This is because object variables are really handles. (made to syntactically resemble normal variables) In the definition of Object Pascal they extended the definition of the with statement to include its use with object. If Doyle's warning applies, this seems pretty silly. Note: I'm taking the point of view of 'vanilla' Object Pascal programming, no HLock to help me out. I know the term 'vanilla' Object Pascal may seem self contradictory, but Apple did get their definition published in 'Structured Language World' so I assume they have some interest in it being accepted elsewhere. Also, for similar reasons Doyle warns against using an object's field as a var parameter. The language definition seems to allow it, if it is a problem then I have the same complaint again. The answer to my question is probably compiler specific. A clever compiler could have implented Object Pascal so that Doyle's warning were not applicable. I use LSP. Are you listening Rich? -ME