SCOUG Logo


Next Meeting: Sat, TBD
Meeting Directions


Be a Member
Join SCOUG

Navigation:


Help with Searching

20 Most Recent Documents
Search Archives
Index by date, title, author, category.


Features:

Mr. Know-It-All
Ink
Download!










SCOUG:

Home

Email Lists

SIGs (Internet, General Interest, Programming, Network, more..)

Online Chats

Business

Past Presentations

Credits

Submissions

Contact SCOUG

Copyright SCOUG



warp expowest
Pictures from Sept. 1999

The views expressed in articles on this site are those of their authors.

warptech
SCOUG was there!


Copyright 1998-2024, 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.

The Southern California OS/2 User Group
USA

SCOUG-Programming Mailing List Archives

Return to [ 13 | February | 2004 ]

<< Previous Message << >> Next Message >>


Date: Fri, 13 Feb 2004 18:23:06 PST8
From: Peter Skye <pskye@peterskye.com >
Reply-To: scoug-programming@scoug.com
To: scoug-programming@scoug.com
Subject: SCOUG-Programming: PL/I most important statement (was: call(TZ) ? - PL/I)

Content Type: text/plain

Lynn H. Maxson wrote:
>
> I gave you the two historical reasons for the BEGIN statement.
> You offer me one unnecessary instance of its use.

Them's fightin' words.

> you want something like the following:
>
> [scurrilous setup code here, followed by . . .]
> dcl matrix (*,2) fixed dec (7,2) based(voom);
> dcl voom ptr static;
> if rotor != 0
> then do;
> allocate matrix (rotor, 2);
> .
> .
>
> The only use for the "begin" block here is to handle the
> endfile condition for the input file. There's no need
> for a "begin" block to allocate space for the matrix.

Now let me get this straight. You constantly revile the likes of C
which, if my neurons be connected this late in the day, has a memalloc()
call. You entice us mightily with the hidden persuasions of PL/I. And
then, when a daring young man (me) chooses to bypass the horrid
memalloc() call by using the most-high-level BEGIN block of PL/I, some
anti-BEGIN conjurer (you) decides it's a dastardly act indeed.

*My* code is nice and tidy and doesn't have to worry about allocations
or deallocations. *Your* code reminds me of those terrible C memallocs
which the programmer must keep track of lest he forget to release those
allocated bytes.

Throw that allocate in the trash can, Lynn. Use BEGIN.

> Before PL/Id had the "based" storage attribute it had
> "static", "automatic", and "control". You could have
> allocated ... allocate ... allocate ... deallocate ...
> continuing this process until you had exhausted the stack.
>
> In short the "allocate" statement in PL/I . . .

I'm trying to get _away_ from memory management. BEGIN takes care of
everything for me. Why use PL/I to write a C-styled program?

You're thinking too low-level. Forget about this memalloc stuff.

> you would have to have its dimension outside the "begin"
> segment and declare the matrix as an 'automatic' storage
> variable to have PL/I automatically allocate it on entry
> to the "begin" segment. All your processing of the matrix
> would have to occur within the "begin" segment as PL/I
> would automatically deallocate it upon exit, i.e. reaching
> the "end" statement for the "begin" block. I don't know
> why you would go to all this trouble when you could simply
> allocate it dynamically in the first place using either
> the "controlled" or "based" storage attribute.

That's the beauty of PL/I. While I write the program I can concentrate
on the problem to be solved, not the housekeeping required.

- 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 [ 13 | 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.