On 17 Apr 2004 at 15:20, Eike Lange wrote:
- April 2004 13:03 schrieb Prof A Olowofoyeku (The African Chief): >
Delphi (at least, from from version 2.0 onwards) allows > routines that take no parameters to be called with empty brackets > appended (e.g., "foo();"), much like C requires. See the test > program below. GPC does not allow this. Is there any chance of > supporting this in GPC? > This program is valid in Delphi, but not in GPC ... > begin > foo (); > end.
What would you think about using braces instead? begin foo {}; end.
I don't think, we should support C-style routines.
I do not use the empty brackets when coding myself. As I said, it is for compatibility. Having just spent about an hour dealing with this in some existing code that I was porting to GPC, I thought it would have been very nice indeed to have not had to do that. Delphi has had this for nearly 9 years, and it is not going to disappear from Delphi. As long as we want to support Delphi features, we might as well have it (assuming it is easy to implement - which, considering the C backend, I would imagine should not be too difficult). If it is difficult or messy to support, then I guess I'll just have to live with having to sort things out manually when porting existing Delphi code (or perhaps write a program to do it automatically).
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/