× 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.



Steve Richter wrote:
...
in the first version, the explicit return type is only needed if the
operator+ is ambiguous. ( and if the procs are only overloaded on primitive
return types like char and bin. in practice, one proc may return a string,
others would return different data structures. In such a case, operator+ is
not ambiguous. )
...

You're still missing the issue that some expression that's unambiguous in one release may well be ambiguous in the next, given certain possible enhancements. For that reason alone, return value types should not be part of the parameter signature. That is, on moving a program from one release to the next, you shouldn't have to add any type coercions.



Anyway, I am thinking that the need for procedure overloading may just be a
placeholder for the need for namespaces.  Where two procs, in two different
include files, are allowed to have the same name because their arguments are
different.  In such a case, namespaces would be a better way to allow the
procs to have the same name:

Using overloading to distinguish two procs:
     PrintOrder( PurchaseOrder_DataStruct ) ;
     PrintOrder( CustOrder_DataStruct ) ;

Better to use namespaces:
     purchasing::PrintOrder( arg1 ) ;
     customer::PrintOrder( arg1 ) ;


Well, namespaces is another totally unrelated issue. And frankly, I'm surprised that more RPG programmers don't seem to think that's an issue.


Cheers! Hans



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.