Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Marc Weustink
Daniël Mantione wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Here is a proposal of the syntax: type TGenericClassT,F = class public procedure Add(Item: T; Flag: F); end; This syntax is almost impossible to implement since in one of your other mails the symbols to mark the

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Florian Klaempfl
Daniël Mantione wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Here is a proposal of the syntax: type TGenericClassT,F = class public procedure Add(Item: T; Flag: F); end; This syntax is almost impossible to implement since in one of your other mails the symbols to

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Mattias Gaertner
On Fri, 04 Nov 2005 10:47:42 +0100 Marc Weustink [EMAIL PROTECTED] wrote: Daniël Mantione wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Here is a proposal of the syntax: type TGenericClassT,F = class public procedure Add(Item: T; Flag: F); end; This

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Micha Nelissen
Marc Weustink wrote: BTW, what woud be the problem with type TMySpecificClass = TGenericClass(TObject, Integer); Or: code type TGenericCollection = generic(T: TCollectionItem) class(TComponent) ...implement TCollection and use T end; TCollection = TGenericCollection of

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Mattias Gaertner
On Fri, 04 Nov 2005 13:44:55 +0100 Marc Weustink [EMAIL PROTECTED] wrote: Mattias Gaertner wrote: On Fri, 04 Nov 2005 10:47:42 +0100 Marc Weustink [EMAIL PROTECTED] wrote: Daniël Mantione wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Here is a proposal of the syntax:

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Ales Katona
Micha Nelissen wrote: Marc Weustink wrote: BTW, what woud be the problem with type TMySpecificClass = TGenericClass(TObject, Integer); Or: code type TGenericCollection = generic(T: TCollectionItem) class(TComponent) ...implement TCollection and use T end; TCollection =

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Ales Katona
Example: procedure MyProc(T); // generic procedure without parameters ver i: T; begin ... end; procedure MyProc(T: TClass); // non generic procedure begin end; Call MyProc(TObject); What will happen? Mattias Sky will reign fire: procedure (var T); begin // generic or not?? end;

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Marc Weustink
Ales Katona wrote: Micha Nelissen wrote: Marc Weustink wrote: BTW, what woud be the problem with type TMySpecificClass = TGenericClass(TObject, Integer); Or: code type TGenericCollection = generic(T: TCollectionItem) class(TComponent) ...implement TCollection and use T end;

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Micha Nelissen
Micha Nelissen wrote: code type TGenericCollection = generic(T: TCollectionItem) class(TComponent) ...implement TCollection and use T end; TCollection = TGenericCollection of (TCollectionItem); TFieldDefs = TGenericCollection of (TFieldDef); /code So generic procs could look like:

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Vinzent Hoefler
On Friday 04 November 2005 13:00, Micha Nelissen wrote: Combining some of the wiki ideas, and has no evil characters :-). I don't understand the fuzz about using . It's not even close to being C(++)-ish, because it was used for describing discrete range types _at least_ in Ada's generics

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Marc Weustink
Mattias Gaertner wrote: On Fri, 04 Nov 2005 13:44:55 +0100 Marc Weustink [EMAIL PROTECTED] wrote: Mattias Gaertner wrote: On Fri, 04 Nov 2005 10:47:42 +0100 Marc Weustink [EMAIL PROTECTED] wrote: Daniël Mantione wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Here is a

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Marco van de Voort
types _at least_ in Ada's generics back in 1983[*] already. Perhaps someone should take a look at those, because these are also quite different from C++-templates. Vinzent. [*] That would be the same year the term C++ just appeared first in history of programming languages then, and

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Peter Vreman
Micha Nelissen wrote: code type TGenericCollection = generic(T: TCollectionItem) class(TComponent) ...implement TCollection and use T end; TCollection = TGenericCollection of (TCollectionItem); TFieldDefs = TGenericCollection of (TFieldDef); /code So generic procs could look

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Vinzent Hoefler
On Friday 04 November 2005 13:27, Marco van de Voort wrote: [] The evil is in - using characters instead of modifiers. - worse, recycling already used characters. Alright, I completely understand at least the first part, so perhaps they should simply not be overused. :-) Just for the fun

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Micha Nelissen
Peter Vreman wrote: Expiriment, feed g++ code with errors in the statements. With macro's those errors won't be show until the macro is used. But with templates this is diffent: Smart indeed :) This is more important than the syntactical sugar. The rules where to declare generics and

[fpc-devel] Templates / Generics Syntax

2005-11-03 Thread Mattias Gaertner
Here is a proposal of the syntax: type TGenericClassT,F = class public procedure Add(Item: T; Flag: F); end; procedure TGenericClass.Add(Item: T; Flag: F); // Note: No redundant T,F after TGenericClass. begin end; I think, the parameters should be at the identifier name, not in the

Re: [fpc-devel] Templates / Generics Syntax

2005-11-03 Thread Mattias Gaertner
On Thu, 3 Nov 2005 19:59:40 +0100 (CET) Daniël Mantione [EMAIL PROTECTED] wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Here is a proposal of the syntax: type TGenericClassT,F = class public procedure Add(Item: T; Flag: F); end; This syntax is almost

Re: [fpc-devel] Templates / Generics Syntax

2005-11-03 Thread Mattias Gaertner
On Thu, 3 Nov 2005 20:10:35 +0100 Mattias Gaertner [EMAIL PROTECTED] wrote: On Thu, 3 Nov 2005 19:59:40 +0100 (CET) Daniël Mantione [EMAIL PROTECTED] wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Here is a proposal of the syntax: type TGenericClassT,F =

Re: [fpc-devel] Templates / Generics Syntax

2005-11-03 Thread Daniël Mantione
Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Right. I didn't think of that. What about edged brackets? type TGenericClass[T,F] = class public procedure Add(Item: T; Flag: F); end; At first sight it looks okay. If necessary it is possible to introduce a two character

Re: [fpc-devel] Templates / Generics Syntax

2005-11-03 Thread Mattias Gaertner
On Thu, 3 Nov 2005 20:25:07 +0100 (CET) Daniël Mantione [EMAIL PROTECTED] wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Right. I didn't think of that. What about edged brackets? type TGenericClass[T,F] = class public procedure Add(Item: T; Flag: F);

Re: [fpc-devel] Templates / Generics Syntax

2005-11-03 Thread Mattias Gaertner
On Thu, 03 Nov 2005 22:35:34 +0100 Peter Vreman [EMAIL PROTECTED] wrote: At 20:41 3-11-2005, you wrote: On Thu, 3 Nov 2005 20:25:07 +0100 (CET) Daniël Mantione [EMAIL PROTECTED] wrote: Op Thu, 3 Nov 2005, schreef Mattias Gaertner: Right. I didn't think of that. What