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




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Hans Boldt
Sent: Tuesday, September 02, 2003 8:27 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: CEETSTA API


Scott Klement wrote:
> ...
> I won't.  I don't like overloading.  I think it's confusing when the
> compiler gives you an error "procedure not found" and the reason turns out
> to be that one of your variables is a "short" and the procedure was
> expecting an "int".   That's not intuitive.

Having to assign different names to procedures that do the same thing is
counter intuitive, hence confusing, also.  For example, consider a procedure
named "ToString".  It converts its arguments to string form and returns the
string to the caller.
  ToString( int ) ;                   // will edit using edit code 'Z' ...
  ToString( packed with precision ) ; // will edit using edit code 'J' ...
  ToString( EmployeeMaster DS ) ;     // will return empl# employee name

> I don't like it when I search a program for a procedure called "GetCust"
> fix a bug in it, and it has no effect because there's more than one
> procedure called GetCust.

a common use of overloads is to have the different versions feed into a
common proc.  In such a case, the bug or change probably exists in the
common proc, meaning only the common proc has to be worked on.

here is another example:
    Write_Inventory_Trans_Record( Order_Fullfillment_DS ) ;
    Write_Inventory_Trans_Record( Credit_Memo_DS ) ;

> I don't like having to specify a "mangled" name when creating binder
> source, or when using %paddr().

procedure overloading is a job for the ILE dept.  Are they still in
business?

> The problems of overloading far outweight the minor difficulties of making
> procedure names like "GetCustByName" instead of "GetCustByNumber"

Not if you are trained to look to the arguments passed to the overloaded
proc. Once you are familiar with it, it becomes another tool that is
available for writing solid code.



Hans wrote:

>Procedure name overloading is one enhancement that's at or near the
>top of our "proposed enhancements" list. But at the moment we're
>nowhere near having a solid design for such a thing. All we have now
>are ideas tossed about in the hallway. This present discussion,
>therefore, is incredibly useful for us.

>Personally, I too am not a big fan of overloading. But there does
>seem some demand for that type of functionality, and can serve to
>bridge the gap in operational descriptor functionality. Since types
>are known at compile time, there's no really good reason programmers
>should have to query types at run time (except to get the length of
>char parameters, but then again you could use VARYING strings).

I am curious, does JAVA support overloading?

>Perhaps this is still too early to discuss design (or perhaps not),
>but here are some of our (very) preliminary thoughts. One possible
>design would have you code different procedures each with a unique
>name and parameter signature. (For example, "GetCustByName" and
>"GetCustByNumber".) Then, we'd have some syntax that would alias
>them to one name. That is, an overloaded name like "GetCust" would
>be associated with procedures "GetCustByName" and "GetCustByNumber".
>This would probably be the easiest for us to implement since the
>only new syntax would be a list of aliased procedures. You could
>easily interface to procedures written in other languages, and there
>wouldn't be any "magical" name mangling.

Why is the ILE dept not handling overloading?  Is ILE dead?  I thought ILE
was a stategic, cross platform whatever to IBM.   Or was ILE just a plot
hatched to kill the data pointer?

>Regarding "short" and "int" possibly being two different types, I
>would guess that we would consider all numerics as being of the same
>type.

Let the programmer decide how to design their overloads.  The compiler
simply selects the overload that matches the arguments.  If the choice is
ambiguous because of data type conversion, then either kick it out, or
provide %bifs that convert to specific data types:
     %int_10_0( value ) ;    // converts to 10i 0
     %packed_5_2( value ) ;  // converts to 5p 2

-Steve



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.