Prof A Olowofoyeku (The African Chief) wrote:
Does it allow user-defined optional parameters? If so, what about `()' then?
I am not sure what you are referring to here. Are you referring to things similar to "Writeln" which currently require compiler magic under GPC?
(AFAIK, `WriteLn' requires compiler magic in any compiler since it allows for an infinite number of combinations of number and types of arguments.)
If so, I guess they would be implemented by the overloading mechanism, and if one of the overloaded routines takes no parameters, then this whould be okay - for example, this is perfectly legal;
OK.
If you were referring to something like "default parameters", then this is what the Delphi 7 help file says:
"You can omit parentheses when passing all and only the default parameters to a routine. For example, given the procedure procedure DoSomething(X: Real = 1.0; I: Integer = 0; S: string = ''); the following calls are equivalent. DoSomething(); DoSomething;"
That's what I meant.
So we'll have to remember to test these cases when we implement overloading and/or optional parameters.
Frank