SCOUG-Programming Mailing List Archives
Return to [ 14 |
February |
2004 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
Lynn H. Maxson wrote:
>
> You created work for yourself by using a begin-block,
> requiring both a begin and an end statement. You could
> have achieved both with an allocate statement, letting
> the system deallocate on procedure end.
This is absolutely false. It is also poor programming. And it is
wrong.
Consider the following block sequence as exists in my software (this is
not complete code):
begin
dcl Matrix1(X,Y);
end;
begin
dcl Matrix2(A,B);
end;
begin
dcl Matrix3(P,Q);
end;
*My* method keeps memory usage to a minimum. *Your* method (no BEGINs
and no deallocs) allows it to grow without bounds.
My matrices can be bigger than yours 'cause they don't all exist at the
same time. Nyaa nyaa!
> In point of fact the initial attribute applies to both
> static and automatic storage variables. The initial value
> itself is applied to a static variable during compile time
> while that of an automatic variable occurs at runtime on
> entry to a procedure.
I've known this for over 35 years.
> I think Bob is probably still scratching his
> head wondering how he reinforced your view.
Well, ask him. He didn't take sides, and I've always admired the way he
can say something in far fewer words than I.
Bob said two things: 1) In PL/I, unlike C, "the compiler does it" and
2) In a PROC the memory is freed when the PROC terminates.
I'm letting "the compiler do it" while you insist on "doing it"
manually. And neither of us is promoting PROCs.
> If you want to dynamically allocate storage for a variable,
> then give it the 'controlled' or 'based' storage attribute
> and use an 'allocate variable;' statement. The fact that
> you can achieve something similar with a variable with an
> 'automatic' storage attribute in a begin-block has nothing
> to do with the two purposes the language authors had in its
> implementation.
I'm only allowed to write the program routines which the authors of the
language preconceived 40 years ago? What have _you_ been smoking?
[Lurkers: Lynn and I are good friends. We enjoy animated debates.
Among other things, a good debate exposes whether or not you really know
what you're talking about -- something which Lynn and I have never
agreed on to this day.]
- Peter
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 14 |
February |
2004 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|