Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

COMPUTE (was: "Goto statement considered superfluous" (was: If you were inventing C)
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
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
09-28-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:32 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.