I've been pretty busy, sorry it took so long to respond (because I know you were dying for me to respond, ha).
Simon, never one to hold back on harsh judgement. It's fine that you don't agree. However, comments such as:
"I consider what you're asking for to be a nonsense request and you
shouldn't waste IBM's time by making them reject it."
...serve no purpose but to inflame.
"Why is this so different from what already happens in the mainline?"
It isn't. That's exactly what I was saying.
I should probably be careful because people might accuse me of wanting RPG to be not RPG, but really, I want it to be a language that in itself sparks interest in people. Every conference I go to there's a concern voiced about the lack of interest in our beautiful language. Yes, it's a great language for business apps, it has been this way for a long time, whether or not I liked programming in it (fixed format, pre-RPG IV? Ugh!) But there's a reason why IBM "freed" C-specs - demand. And people want IBM to "free up" the other specs as well, me included.
I'm just saying I want the language to evolve. Yeah, my suggestion, whether people agree or not, is to list parameters first - to me it's the most logical. Yeah, that may break our defined order of *-specs in a program. But here's hoping the idea of "freeing" the other specs will make that aspect of RPG obsolete.
Anyway, just brainstorming.
-Kurt Anderson
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Simon Coulter
Sent: Thursday, May 28, 2009 6:21 PM
To: RPG programming on the IBM i / System i
Subject: Re: Sub procedure end specification
On 29/05/2009, at 4:34 AM, Kurt Anderson wrote:
In 6.1 IBM has introduced local F-Specs which appear between the P
spec and the D-spec with the PI and parms. This now pushes the
parameters deeper into the procedure. It would be nice if RPG was
enhanced to allow for a P-spec to house the PI (in addition to the D-
spec for sake of backwards compatibility). That way we could have
the parameters be the first thing in the procedure.
Why is this so different from what already happens in the mainline?
Files are declared before the D-specs containing the PI for the
program itself (or before the C-specs containing the *ENTRY PLIST if
you're still using that method).
Look at CL. First thing you have (after comments) are your
parameters if you have any. That's pretty nice. RPG once required
them way down in the C-specs, then gave us the option to list them
in the D-specs, which I really liked. But ultimately, if the
parameters appeared at the beginning of the procedure (as they do in
CL, C++, Java), I think the presentation of code would flow smoother.
You need to rethink what you're really asking for. Firstly, CL only
NAMES (i.e., declares) the parameters on the PGM command. the
parameters themselves are defined later in the code on a DCL command
along with all the other variables used in the program. Java, C (and
its derivatives) and others both declare and define parameters in the
function interface (unless you adopt the ugly and rather stupid K&R
convention for C).
So do you want it like CL where you only name the parameters on the P-
spec and have a later D-spec to define them, or like Java where you
define the parameters on the P-spec? How would the P-spec look in each
of these cases? Where would any return value be defined? Currently,
ALL variables in an RPG IV program are defined on D-specs unless you
use the archaic support for C-spec data. You're asking that we now
have two places to define procedure variables and that seems messy.
While traditional RPG programmers see no difference between variables
and fields (i.e., from files) that's more a conceptual thing--it's
just what they're used to and RPG terminology reinforces that. RPG,
COBOL, CL, PL/1 and others have separate file definitions and variable
definitions. I think that's a good thing so I would not consider
separate F-specs as an argument for data definition on a P-spec. Thus
files defined in one place, variables defined in one place, and
parameters defined in one place.
I consider what you're asking for to be a nonsense request and you
shouldn't waste IBM's time by making them reject it.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists
http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.