SCOUG-Programming Mailing List Archives
Return to [ 02 |
April |
2003 ]
>> Next Message >>
Content Type: text/plain
"Me and my big mouth--Fortran doesn't have recursion, but I
have seen it faked. Now if I could just remember the graody
hack... "
Recursion occurs through an iterative process. You've seen it
"faked" through "normal" iteration, e.g. "do while...", for
functions like factorial. Fortran's problem runs a little deeper
as at least through Fortran IV it had only "static", i.e.
pre-allocated storage, data support.
In 1962 when SHARE and IBM collaborated on Fortran VI, the
original designation for what evolved into PL/I, the major
competition for Fortran was Algol in which "automatic"
storage, not "static", was the default. Automatic storage gets
allocated on entry into a procedure and de-allocated on exit.
It could support recursion then by essentially "stacking"
allocations on each recursive entry and then unstacking
(de-allocating) them on exit.
Fortunately before the SHARE group finished up with all the
changes they wanted to Fortran on the scientific side the
GUIDE group got into the act with the changes they wanted on
the business side, e.g. to COMTRAN and COBOL. By that time it
no longer had backward compatibility with Fortran. So they
changed the designation to "New Programming Language" or
NPL. That got them into copyright problems with the
English(?) firm Nuclear Physics Laboratory, which caused the
shift to Programming Language/One or PL/I.
The implication here was clear. If this was "one", there would
be a "two". That was often offered as the excuse for
customers not to implement "one": waiting for "two". IBM
itself internally took it to 2, 3, 4, 5, 6, 7, and 8, eventually to
an internally used language, PL/S, for their S/360/370/390
operating systems.
So you can fake it for functions like factorial in Fortran as the
control data values 1, 2, 3, ... are created dynamically in the
course of iteration. This differs from the ability to create data
variables dynamically as required in recursion.
Now if the APL folks would offer up an example of this peg
solitaire problem we could get a leg up on some comparative
lignguistics that illustrates how programming languages differ
and how they do not relative to the same situation.
=====================================================
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".
=====================================================
>> Next Message >>
Return to [ 02 |
April |
2003 ]
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.
|