× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have a slight advantage over you on this one Dieter because I was involved in many discussions on how to do the kind of things you're talking about. It is perhaps not as easy as you would have us believe.

It has to be system wide. It has to include every callable IBM object as well as all user callable objects. It would require recompilation of all objects from source because for the most part the information on the requirements is not readily determined from the object itself.

Also "This seems to me very similar to putting the source into the object for debug purpose" - well in most cases the source is not put into the object. A _reference_ to the source file is. Unless listing view is requested of course. But this is just a simple matter of placing data in the associated space. Not a lot of design needed. Note also that it only works if you can recompile.

Just a few other issues off the top of my head:

- Not only do the parameters have to be described but you also need all the other characteristics - CONST, VALUE, DATFMT, and on and on.
- How many signatures do we carry given optional parameters?
- What about C style functions with an "unlimited" number of parms? What does that signature look like?
- If extend the data to allow for passing of a DS array how do I constrain the number of elements passed?
- What do we do about languages like CL and COBOL that have no notion of prototyping? Stop RPG programmers from calling them via a CONST option that would allow for variance in field sizes?

This is a tiny portion of the issues that were raised during the ILE design phase and subsequently. It was a lot of years ago (25+) so I've undoubtedly forgotten many.

I think we have to accept that a "perfect" solution is unlikely and work towards a "best practical" solution.


www.partner400.com
www.SystemiDeveloper.com

On Mar 5, 2018, at 12:08 PM, D*B <dieter.bender@xxxxxxxxxxxx> wrote:

Hi,
I don't realy understand, why it should be so hard to do.
Right now we have:
at compiletime: checking against the declaration of a prototype, rather weak hopefully the same prototype is used as in the implementation.
at bind process: resolving symbols by name, binding by position (could be stronger, if bound by name), creating a signature (could be stronger if the signature would use name and parms) - the real problem here is, that many people fake the signature to avoid rebind needs (strange, very strange!!!)
at runtime: signature check.

IMHO it wouldn't be too hard ton enhance this process:
- no check needed at compiletime, just making a list of unresolved references, including parms would be enough
- at bind time: check use of unresolved references against the list of exports in all components (modules, SRVPGMS) available by parm of bindprocess.
in other words: move the checking usage against PR from compile to bind. To make this happen, write the declarations of the exports in the header section of the Modules/SRVPGMs. This seems to me very similar to putting the source into the object for debug purpose.

Regards

Dieter

<Jon>
OK - I see where you are coming from - but, as you seem to realize, what you would like is hardly a practical option.

What would be required to enable the "PI rules" philosophy is a system wide extension that captures the full details of the parameters and return value. Right now the closest we have to that is PCML and that has multiple problems including an inability to be able to represent a number of parameter types. Even if that problem were addressed (not likely worth IBM's investment) then there is still the problem of late binding. For instance a dynamically called program can be subject to library list and other factors - how can the compiler validate against something that may not even exist at compile time. Same problem with Service Program procedures that are dynamically bound - or bound via procedure pointer.

I am interested in minimizing problems with what we have and asking for extensions (such as the RFE in question) that help to avoid errors. I think we have more chance of IBM i being open sourced than seeing the types of changes needed to avoid protos altogether.


Jon Paris
</Jon>
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.