Prof. A Olowofoyeku (The African Chief) wrote:
Newer versions of Delphi (IIRC, from v4.0 onwards) permit a somewhat C-like procedure/function call - e.g., if you have these routines: function foo : integer; procedure bar;
You can call them like this; i := foo; // GPC expects this bar; // -- ditto --
j := foo (); // Delphi accepts, but GPC doesn't bar(); // -- ditto --
I thing that it would be nice if GPC could support the addition of the brackets, but there may well be strong reasons for not doing so (for one, it is un-Pascalish). I also do not know whether it would be easy or difficult to implement. I fully appreciate that there are many other things that are far greater priorities - but if it could be done easily then should it? I find that many Delphi programmers are increasingly doing this (probably those who came from a C/C++ background) and so it gets a bit cumbersome to deal with them when trying to port free Delphi code to GPC.
<sarcasm> I think that's a very useful feature. It makes the language so much clearer and allows for many things that weren't possible otherwise. Now only one step is missing -- to finally call the language C with extensions ...
Oh yeah, and allow `{'/`}' for `begin'/`end'. The confusion with old-fashioned Pascal comments should be no problem since they have already C++ style comments.
I think that feature may be necessary for Delphi compatibility. But I start to wonder if we're the right project to do this. Maybe the GNU C developers should go for it, they're language seems to be much closer already. </sarcasm>
Honestly, what craziness made them add such a feature? If programmers come from C/C++ to a (slightly) Pascalish language, one might think they would at least want to learn the basics of the language. Otherwise, why don't they stay with C/C++? Even Borland has a C++ compiler, don't they?
Andrew McCall wrote:
I personally don't like it that much :) However I agree that it maybe usefull for porting purposes.
Its probably pretty easy due to the fact that you can already pass varibles via parameter(? or is it value.... I forget my Pascal education :) ).
You can pass values and variables as parameters. ;-)
If it is added, perhaps a compile warning could be generated for each instance of the usage of the ()'s this would let people know that its not "real" Pascal.
If it's added (and I'm really not sure about it), it should at least produce a fat warning by default and an error in any other dialect except `--delphi'.
This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
Actually, it doesn't. Such a message can be inserted by anyone, even by a virus. ;-) In order to have any meaning, it should at least contain a cryptographic signature.
Frank