Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!swrinde!ucsd!ucbvax!CIM-VAX.HONEYWELL.COM!derstad From: derstad@CIM-VAX.HONEYWELL.COM ("DAVE ERSTAD") Newsgroups: comp.sys.apollo Subject: Re: The wonderful Pascal compiler... Message-ID: <9011141659.AA08276@umix.cc.umich.edu> Date: 14 Nov 90 16:45:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 33 To elaborate on Jim's comments (in hopefully a friendlier fashion :-)) on the null pointer de-referencing, it is important to recognize that Pascal, unlike C, does not specify order of expression evaluation (unless this changed in the ISO standard, which I doubt). For example, the Pascal code if (exprA) or (exprB) may have either exprA or exprB evaluated first. A compiler may choose to do one or the other consistently; do the more efficient one; or choose one based on the phase of the moon and be "correct". Likewise, with if (exprA) and (exprB) a compiler may choose to evaluate both expressions even if the first one it evaluates is false. In fact, it MUST evaluate both when there is the potential for side effects. C, by contrast, guarantees both order of evaluation and short circuiting. C supporters argue this is good, pointing to examples like your code. Detractors would argue this makes code more difficult to maintain. So, in short, Apollo' s compilers are not to blame (this time). BTW, there are Domain pascal extensions to specify order of evaluation (or else; and then), but I wouldn't recommend them as they are non-standard. Dave Erstad DERSTAD@cim-vax.honeywell.com Honeywell SSEC