|
Barbara Morris wrote: >> Regarding bug or feature, I don't think it's either. I think it would >> be great if the ILE environment could provide something that I don't >> think is available anywhere else, namely runtime checking of parameters. >> But the system works the way it works. The existence of %parms and >> *PARMS implies that the system won't prevent you from accessing >> parameters that are not passed; the fact that failure to check %parms >> sometimes causes a nice pointer-not-set error doesn't mean that problems >> from not checking %parms are limited to that error. Then Scott Klement wrote: >But if that minimal operational descriptor that you mentioned earlier >isn't being passed, you couldn't actually check %parms anyway, could you? > >It sounded to me like it didn't actually know how many parms were passed? Scott, RPG can't check the %parms value because it might not be correct. But if a programmer writes a procedure that expects an to be able to check %parms, and and the caller doesn't pass an operational descriptor, it's the programmer's error, one way or another. (The documentation for %parms mentions the fact that other languages don't necessarily pass the OD.) I think the number-of-parms not always being available is indeed a performance decision. I personally think the default should have been to pass the minimal OD, but by the time RPG got on the ILE scene, the die was already cast. (C has a different convention for handling varying length parameter lists.) Barbara Morris +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.