Code Comments
Programming Forum and web based access to our favorite programming groups.Chuck, I didn't check out the '74 Standard, but at least in the '85 Standard the *entire* COMPUTE statement is in Nucleus level 2. Therefore, a conforming Minimum or Intermediate level compiler need not support it. That doesn't me an it wasn't in the Standard - but this *might* have lead to some confusion, i. e. "conforming '68 or '74 compiler didn't include COMPUTE". Personally, I don't know of any that did NOT have this statement, but it was possible. -- Bill Klein wmklein <at> ix.netcom.com "Chuck Stevens" <charles.stevens@unisys.com> wrote in message news:cj1rjd$g7i$1@si05.rsvl.unisys.com... > > "Richard" <riplin@Azonic.co.nz> wrote in message > news:217e491a.0409241040.5d748b06@posting.google.com... > > > No, again, I believe the evidence shows that is *not* the case. > > The available evidence has convinced me that COMPUTE has been in COBOL sin ce > its very beginnings. What *wasn't* in the earliest forms of COBOL was > *multiple-destination* COMPUTE (nor were multiple-destination ADD, SUBTRAC T, > MULTIPLY or DIVIDE, for that matter). > > > As I see it, that's needed *only* for *multiple-destination* COMPUTE (and > only then if the descriptions of the destinations differ). With 2002 > COBOL, and the availability of SIDI's, in *standard* arithmetic all the > operands are treated as if they're in SIDI's in the first place, so there' s > no distinction between the simple COMPUTE and the simple ADD, for example. > > I don't see anything in any of the COBOL standards that prevents > implementors from making a simple COMPUTE just as fast and just as efficie nt > as an equivalent ADD, SUBTRACT MULTIPLY or DIVIDE statement given the > knowledge the compiler has of the operands, the operators, and the > destination, even in native arithmetic, although I can understand that an > implementor might choose not to bother. > > Our COBOL74 and COBOL85 compilers both generate *exactly* the same code fo r > each of these statements: > ADD A 1 GIVING A. > ADD 1 TO A. > COMPUTE A = A + 1. > What in the standards *requires* that the code be different? > > -Chuck Stevens > >
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.