Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-04

generic, specialize keywords in mode delphi in FPC trunk

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

cobines

Hello.

Following program:

program a;
{$mode delphi}
type
  generic TGen<T> = class end;
  TSpc = specialize TGen<Integer>;
begin
end.

compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306:

a.pas(4,11) Fatal: Syntax error, "=" expected but "identifier TGEN" found
a.pas(5,21) Error: Identifier not found "specialize"
a.pas(5,21) Error: Error in type definition
a.pas(5,21) Fatal: Syntax error, ";" expected but "identifier TGEN" found

"generic" and "specialize" are not allowed in delphi mode in 2.5.1 but they are required in 2.4.2.

Is this a conscious change? There is no mention of this on Wiki User Changes 2.4.4 or User Changes Trunk pages.

cobines

Reply by email

Paul Ishenin
to cobines
cobines wrote 24 lines
Hello. Following program: program a; {$mode delphi} type generic TGen<T> = class end; TSpc = specialize TGen<Integer>; begin end. compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306: a.pas(4,11) Fatal: Syntax error, "=" expected but "identifier TGEN" found a.pas(5,21) Error: Identifier not found "specialize" a.pas(5,21) Error: Error in type definition a.pas(5,21) Fatal: Syntax error, ";" expected but "identifier TGEN" found "generic" and "specialize" are not allowed in delphi mode in 2.5.1 but they are required in 2.4.2. Is this a conscious change? There is no mention of this on Wiki User Changes 2.4.4 or User Changes Trunk pages.

In mode delphi FPC understands delphi generic syntax. I did not write a line to the

User Changes Trunk because this work is not finished. But looking at my free time I don't think it will be finished by me, so I will add a note there today.

Best regards,
Paul Ishenin

Reply by email

leledumbo
to cobines: Hello. Following program: program a; {$mode delphi} type generic TGen<T> = class end;…

Since FPC in Delphi mode supports Delphi style generics syntax, FPC's own generics syntax was removed from this mode. You can still use it from ObjFPC mode.

Reply by email

cobines
to Paul Ishenin: In mode delphi FPC understands delphi generic syntax. I did not write a line to the User…

2011/4/12 Paul Ishenin :

Show quoted text 33 lines
12.04.2011 4:22, cobines wrote: > > Hello. > > Following program: > > program a; > {$mode delphi} > type >   generic TGen<T>  = class end; >   TSpc = specialize TGen<Integer>; > begin > end. > > compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306: > > a.pas(4,11) Fatal: Syntax error, "=" expected but "identifier TGEN" found > a.pas(5,21) Error: Identifier not found "specialize" > a.pas(5,21) Error: Error in type definition > a.pas(5,21) Fatal: Syntax error, ";" expected but "identifier TGEN" found > > "generic" and "specialize" are not allowed in delphi mode in 2.5.1 but > they are required in 2.4.2. > > Is this a conscious change? There is no mention of this on Wiki User > Changes 2.4.4 or User Changes Trunk pages. In mode delphi FPC understands delphi generic syntax. I did not write a line to the User Changes Trunk because this work is not finished. But looking at my free time I don't think it will be finished by me, so I will add a note there today.

OK.
Thanks.

cobines

Reply by email

Sven Barth
to Paul Ishenin: In mode delphi FPC understands delphi generic syntax. I did not write a line to the User…
Paul Ishenin wrote 31 lines
12.04.2011 4:22, cobines wrote: > Hello. > > Following program: > > program a; > {$mode delphi} > type > generic TGen<T> = class end; > TSpc = specialize TGen<Integer>; > begin > end. > > compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306: > > a.pas(4,11) Fatal: Syntax error, "=" expected but "identifier TGEN" found > a.pas(5,21) Error: Identifier not found "specialize" > a.pas(5,21) Error: Error in type definition > a.pas(5,21) Fatal: Syntax error, ";" expected but "identifier TGEN" found > > "generic" and "specialize" are not allowed in delphi mode in 2.5.1 but > they are required in 2.4.2. > > Is this a conscious change? There is no mention of this on Wiki User > Changes 2.4.4 or User Changes Trunk pages. In mode delphi FPC understands delphi generic syntax. I did not write a line to the User Changes Trunk because this work is not finished. But looking at my free time I don't think it will be finished by me, so I will add a note there today.

Would you mind if I'd try to continue/finish that work?

Regards,
Sven

Reply by email

Sven Barth
to Paul Ishenin
Paul Ishenin wrote 7 lines
14.04.2011 15:13, Sven Barth wrote: > Ok, thanks. I created a branch here: > http://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/svenbarth/generics/ Yes, but please wait with the start :) First you need to read generics related threads on the core list. There were some unsolved problems on which I stoped my work.

And here I thought I could jump into the cold water :P

Where can I access the core list archive?

Regards,
Sven

Reply by email