SCOUG-Programming Mailing List Archives
Return to [ 14 | 
February | 
2004 ]
<< Previous Message << 
 >> Next Message >>
 
 
 
Content Type:   text/plain 
"...I prefer to let the compiler do it.  Why create work for   
yourself?  Lynn, wasn't your Warpicity project laced with the   
concept of "let the compiler do it"?"  
 
Let people do what software cannot and software what   
people need not.  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.  As an   
allocate explicitly says "what" you want to occur as opposed   
to the implicit (or silent) allocations of using a begin block, I   
would suggest it provides less confusion for the casual reader.  
 
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.    
That PL/I assigns a default value of 'automatic' to a variable   
instead of 'static' is a hangover from ALGOL.  
 
I think Bob is probably still scratching his head wondering how   
he reinforced your view.  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.  
Of course, you are welcome to make your point by using your   
coding preference to show us how it would work in solving   
the peg solitaire problem as others in our group have done.  
 
 
=====================================================  
 
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.
 
  |