[fpc-pascal] Syntax changes suggestions

Sven Barth pascaldragon at googlemail.com
Sun Jul 22 12:54:05 CEST 2018


Am 21.07.2018 um 22:43 schrieb Ben Grasset:
> On Fri, Jul 20, 2018 at 1:20 AM, Sven Barth via fpc-pascal 
> <fpc-pascal at lists.freepascal.org 
> <mailto:fpc-pascal at lists.freepascal.org>> wrote:
>
>     Because a feature might change the language in a way that's not in
>     the spirit of the language. Look at how Delphi implemented
>     attributes: they're declared in front of the types, fields,
>     parameters, whatever, simply copied from how C# implemented them
>     while in the spirit of Pascal they should have been *after* the
>     declarations.
>
>     Regards,
>     Sven
>
>     _______________________________________________
>     fpc-pascal maillist  - fpc-pascal at lists.freepascal.org
>     <mailto:fpc-pascal at lists.freepascal.org>
>     http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>     <http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal>
>
>
>
> C# itself is heavily inspired by Delphi though, as it's another Anders 
> Hejlsberg project. I fail to see what the "spirit of the language" has 
> to do with anything as far as attributes, either.
>
> Shouldn't the attribute tags just be put wherever it's easiest for the 
> compiler to deal with them?
If we go by that then the current attribute syntax is especially bad, 
because the compiler now needs to gracefully fail with declarations like 
this:

=== code begin ===

[TSomeAttribute]
uses
   foobar;

=== code end ===

If there'd be a syntax to add them as postfix ones then it would be 
easier for the compiler (the following is merely an example):

=== code begin ===

type
   TSomeClass = class(TObject) with [TSomeAttribute]
     fSomeField with [TSomeOtherAttribute]: LongInt;
     property WhatEver: LongInt read fSomeField with [TYetAnotherAttribute];
   end;

=== code end ===

>
> I think the vast majority of people care far more about 
> how/usefulPascal actually is in real life/than they do
> about whether or not it fulfills some not-well-defined notion of 
> "spirit".
And that's why there are people who *do* care about it. Of course you 
can put everything and the kitchen think into a language. But if it 
doesn't fit the language than you'll simply end up with a melting pot 
that doesn't feel coherent. Also while people might not consciously 
think about the spirit of the language I think they'll feel if the 
language is coherent with itself or not.

>
> Also, as far as I can tell, most of the people who use FPC would 
> consider the Delphi way to be the correct or normal way of doing 
> things in the first place.
Considering that more often than not there are discussions on these 
lists if we should continue to follow Delphi compatibility or not you 
might be surprised...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180722/dd2e1aaa/attachment.html>


More information about the fpc-pascal mailing list