Re: [fpc-devel] Templates / Generics; Vote

2005-11-10 Thread listmember
As far as voting goes, personally, I prefer something like this: GList = generic class(T) And, are we going to have non-class rotines, such as event declarations; i.e. TGenericCallback = generic function(AValue1: TGenericValue; AValue2: TGenericValue): Integer; TSomeGenericEvent = generic

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread Micha Nelissen
Micha Nelissen wrote: Ok, to prove this, I've added some ugly examples posted on IRC in the wiki. Look at the bottom of generic keyword syntax examples. Anyone an idea ? :-) Ok I've posted under "Suggestion 2" a slightly modified syntax. Let me know what you think. Micha _

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread Marco van de Voort
> > > > Pro <> reason will probably be: "compatibility". > > Pro "generic" will probably be: more Pascal-alike/readability. > > > Delphi.Net2.0 is using <> > Chrome is using <> > C# is using <> > C/C++ is using <> > > Why should FPC use "generics" ??? Why not if it is better readable and in the p

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread Micha Nelissen
Micha Nelissen wrote: Come on, we're just discussing pros and cons, who knows what the final syntax will be? Ok, to prove this, I've added some ugly examples posted on IRC in the wiki. Look at the bottom of generic keyword syntax examples. Anyone an idea ? :-) Micha ___

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread Micha Nelissen
On Wed, 09 Nov 2005 19:16:46 +0100 [EMAIL PROTECTED] wrote: > Delphi.Net2.0 is using <> Uncertain. > Chrome is using <> Not inventive enough to come up with something of their own and simply following .NET C# syntax. > C# is using <> Duh. It's a C derivative. > C/C++ is using <> Duh, they l

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread Marcel Martin
[EMAIL PROTECTED] wrote: Delphi.Net2.0 is using <> Chrome is using <> C# is using <> C/C++ is using <> Why should FPC use "generics" ??? Why should FPC be Pascal-ish? Is that your question? :-) mm ___ fpc-devel maillist - fpc-devel@lists.freepasc

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread Vincent Snijders
[EMAIL PROTECTED] wrote: Delphi.Net2.0 is using <> Chrome is using <> C# is using <> C/C++ is using <> Why should FPC use "generics" ??? Because it is more readable. < is an operator and therefore should not be used as bracket in generic definition. That b.s. will break the Delphi code

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread rstar
Micha Nelissen wrote: Mattias Gaertner wrote: Hi all, I want to push generics to the next level. For those not familar, there is already a wiki about this topic: http://www.freepascal.org/wiki/index.php/Generics I have tried to organize the "usage example" section a bit, I think most of

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread Michael Van Canneyt
On Wed, 9 Nov 2005, Micha Nelissen wrote: Mattias Gaertner wrote: Hi all, I want to push generics to the next level. For those not familar, there is already a wiki about this topic: http://www.freepascal.org/wiki/index.php/Generics I have tried to organize the "usage example" section a bi

Re: [fpc-devel] Templates / Generics; Vote

2005-11-09 Thread Micha Nelissen
Mattias Gaertner wrote: Hi all, I want to push generics to the next level. For those not familar, there is already a wiki about this topic: http://www.freepascal.org/wiki/index.php/Generics I have tried to organize the "usage example" section a bit, I think most of the "(uncategorized)" item

Rw: [fpc-devel] Templates / Generics

2005-11-09 Thread Joost van der Sluis
On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > Michael Van Canneyt wrote: > >Then they have to publish their specs real soon now. And I mean > >not > >something in a blog, but more something like documentation. We > >can't wait > >another 5 years, until they finally make up thei

Re: [fpc-devel] Templates / Generics

2005-11-09 Thread Joost van der Sluis
On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > Michael Van Canneyt wrote: > >Then they have to publish their specs real soon now. And I mean > >not > >something in a blog, but more something like documentation. We > >can't wait > >another 5 years, until they finally make up thei

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Marco van de Voort
> On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > > > > > Why should Borland reinvent the wheel? > > http://bdn.borland.com/article/0,1410,33383,00.html > > That they will not invent new functionality is clear. > But absolutely nothing is said about pascal _syntax_ for generics. > > How this is t

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Ales Katona
[EMAIL PROTECTED] wrote: You stated that we could know already what the delphi-syntax will be, if they add generics over two years. But we can't, since we don't know what 'pascal-styled' way they will choose. I would say that a pascal-way is adding the 'interface' keyword. Like in array's an

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread joost
On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > Michael Van Canneyt wrote: > >Then they have to publish their specs real soon now. And I mean > >not > >something in a blog, but more something like documentation. We > >can't wait > >another 5 years, until they finally make up thei

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Michael Van Canneyt
On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > Mattias Gaertner wrote: > > > Why do you think, that Borland will use ECMA Standard 334 for C# for the > > Delphi generics? > > Is there any official page, document, statement? > > > > > > > Why should Borland reinvent the wheel? > http://bdn.bor

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread rstar
Mattias Gaertner wrote: Why do you think, that Borland will use ECMA Standard 334 for C# for the Delphi generics? Is there any official page, document, statement? Why should Borland reinvent the wheel? http://bdn.borland.com/article/0,1410,33383,00.html

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Mattias Gaertner
On Tue, 08 Nov 2005 21:06:10 +0100 [EMAIL PROTECTED] wrote: >[...] > >>ECMA Standard 334 > > > >But this is a standard for C#, so totally useless for Pascal syntax-wise. > > > Why useless? You can do exactly the same in a Pascal-styled way. > We need just a minor part from the standard for the FPC

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread rstar
Michael Van Canneyt wrote: On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: Michael Van Canneyt wrote: On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: Vincent Snijders wrote: LOL. Then they have to publish their specs real soon now. And I mean not something in a blog,

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Michael Van Canneyt
On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > Michael Van Canneyt wrote: > > > On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > > > > > > > > > Vincent Snijders wrote: > > > > > > > > > > > > > LOL. > > > > > > > > Then they have to publish their specs real soon now. And I mean > > > > not

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Vincent Snijders
[EMAIL PROTECTED] wrote: Michael Van Canneyt wrote: On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: Vincent Snijders wrote: LOL. Then they have to publish their specs real soon now. And I mean not something in a blog, but more something like documentation. We can't wait another 5 year

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread rstar
Michael Van Canneyt wrote: On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: Vincent Snijders wrote: LOL. Then they have to publish their specs real soon now. And I mean not something in a blog, but more something like documentation. We can't wait another 5 years, until they finally make

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Michael Van Canneyt
On Tue, 8 Nov 2005 [EMAIL PROTECTED] wrote: > Vincent Snijders wrote: > > > LOL. > > > > Then they have to publish their specs real soon now. And I mean not > > something in a blog, but more something like documentation. We can't wait > > another 5 years, until they finally make up their mind.

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread rstar
Vincent Snijders wrote: LOL. Then they have to publish their specs real soon now. And I mean not something in a blog, but more something like documentation. We can't wait another 5 years, until they finally make up their mind. Generics are already standardized. According to Borland, the Win

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Vincent Snijders
[EMAIL PROTECTED] wrote: Marco van de Voort wrote: Delphi incompatibility is a NoGo for FPC. LOL. Then they have to publish their specs real soon now. And I mean not something in a blog, but more something like documentation. We can't wait another 5 years, until they finally make up thei

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread rstar
Marco van de Voort wrote: Florian Klaempfl <[EMAIL PROTECTED]> wrote: Is this correct so far? Ok. So, FPC will follow chrome/Delphi? Afaik there is no need to. Chrome is as relevant as C++, since it is a different language, and Delphi implements .NET stuff, and maybe provi

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread dannym
Hi, Am Freitag, den 04.11.2005, 19:33 +0100 schrieb Peter Vreman: > At 18:17 4-11-2005, you wrote: > >This is evaluated by the pre-compiler run during compile time. > > > >When you use the template with e.g. > >var > >bl: List; > > > >then procedure show(s:string) is taken. > > > > But what if th

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Marco van de Voort
> Marco van de Voort wrote: > > I know Chrome is .NET oriented Delphians pet peeve, but compability wise it > > is irrelevant. It is only interesting for Delphians that really leave > > delphi(.net) behind, but then C# is a choice as well. > > So what you're saying is Chrome is only used by people

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Micha Nelissen
Marco van de Voort wrote: I know Chrome is .NET oriented Delphians pet peeve, but compability wise it is irrelevant. It is only interesting for Delphians that really leave delphi(.net) behind, but then C# is a choice as well. So what you're saying is Chrome is only used by people who hate Borla

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Marco van de Voort
> On Tue, 8 Nov 2005, Marco van de Voort wrote: > > Later on, the -MDelphi switch can be used to implement > delphi-compatible parsing. If they do it differently > from chrome, then we'll implement -MChrome... I don't see any relation between FPC and Chrome. Non trivial Chrome code won't ever r

Re: [fpc-devel] Templates / Generics

2005-11-08 Thread Michael Van Canneyt
On Tue, 8 Nov 2005, Marco van de Voort wrote: Florian Klaempfl <[EMAIL PROTECTED]> wrote: Is this correct so far? Ok. So, FPC will follow chrome/Delphi? Afaik there is no need to. Chrome is as relevant as C++, since it is a different language, and Delphi implements .NET stuff, and maybe

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Marco van de Voort
> Florian Klaempfl <[EMAIL PROTECTED]> wrote: > > > > > > Is this correct so far? > > Ok. So, FPC will follow chrome/Delphi? Afaik there is no need to. Chrome is as relevant as C++, since it is a different language, and Delphi implements .NET stuff, and maybe provides a backwards compat kludge f

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Bram Kuijvenhoven
Peter Vreman wrote: The token-lookahead is a hack and will create more problems and performance loss in a critical part of the compiler. The restriction of type blocks only is not strange at all, Delphi allows 'class of' is also only in type blocks Ok, I didn't know it would be a real ugly hac

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Bram Kuijvenhoven
Mattias Gaertner wrote: On Mon, 07 Nov 2005 23:06:37 +0100 Florian Klaempfl <[EMAIL PROTECTED]> wrote: Ok. So, FPC will follow chrome/Delphi? I would do so, see my mail from the weekend :) I see, but also I see all the other posts still discussing the syntax. I wondered, if it was definitive

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Michael Van Canneyt
On Mon, 7 Nov 2005, Micha Nelissen wrote: > On Mon, 07 Nov 2005 21:07:42 +0100 > Marc Weustink <[EMAIL PROTECTED]> wrote: > > > Params are passed to a procedure define like > > > >procedure MyProc(param, param, ..) > > > > Arrays are declared like > > > >A: array[0..9] of ... > > >

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Mattias Gaertner
On Mon, 07 Nov 2005 23:06:37 +0100 Florian Klaempfl <[EMAIL PROTECTED]> wrote: >[...] > > Ok. So, FPC will follow chrome/Delphi? > > I would do so, see my mail from the weekend :) I see, but also I see all the other posts still discussing the syntax. I wondered, if it was definitive. Mattias _

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Micha Nelissen
On Mon, 07 Nov 2005 21:07:42 +0100 Marc Weustink <[EMAIL PROTECTED]> wrote: > Params are passed to a procedure define like > >procedure MyProc(param, param, ..) > > Arrays are declared like > >A: array[0..9] of ... > > And generics they are soly defined by the fact that a type has

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Florian Klaempfl
Mattias Gaertner wrote: > On Mon, 07 Nov 2005 22:41:06 +0100 > Florian Klaempfl <[EMAIL PROTECTED]> wrote: > > >>Mattias Gaertner wrote: >> >>>On Mon, 07 Nov 2005 19:29:51 +0100 >>>Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: >>> >>> >>> Micha Nelissen wrote: >On Mon, 07 Nov 20

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Mattias Gaertner
On Mon, 07 Nov 2005 22:41:06 +0100 Florian Klaempfl <[EMAIL PROTECTED]> wrote: > Mattias Gaertner wrote: > > On Mon, 07 Nov 2005 19:29:51 +0100 > > Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: > > > > > >>Micha Nelissen wrote: > >> > >>>On Mon, 07 Nov 2005 14:45:19 +0100 > >>>Bram Kuijvenhoven <

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Florian Klaempfl
Mattias Gaertner wrote: > On Mon, 07 Nov 2005 19:29:51 +0100 > Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: > > >>Micha Nelissen wrote: >> >>>On Mon, 07 Nov 2005 14:45:19 +0100 >>>Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: >>> Does <> for generics fit into Pascal? Well, we use [] for array

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Michael Van Canneyt
On Mon, 7 Nov 2005, Anton Tichawa wrote: > Marc Weustink wrote: > > > Bram Kuijvenhoven wrote: > > > > > Micha Nelissen wrote: > > > > > > > Bram Kuijvenhoven wrote: > > > > > > > > > Florian Klaempfl wrote: > > > > > > > > > > > - we'll use a syntax as close as possible to Chrome, e.g. > >

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Anton Tichawa
Marc Weustink wrote: Bram Kuijvenhoven wrote: Micha Nelissen wrote: Bram Kuijvenhoven wrote: Florian Klaempfl wrote: - we'll use a syntax as close as possible to Chrome, e.g. type TList = class ... end; I greatly favor this syntaxis above the generic-modifier. It will look a

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Marc Weustink
Bram Kuijvenhoven wrote: Micha Nelissen wrote: Bram Kuijvenhoven wrote: Florian Klaempfl wrote: - we'll use a syntax as close as possible to Chrome, e.g. type TList = class ... end; I greatly favor this syntaxis above the generic-modifier. It will look at a lot more familiar to

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Mattias Gaertner
On Mon, 07 Nov 2005 19:29:51 +0100 Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: > Micha Nelissen wrote: > > On Mon, 07 Nov 2005 14:45:19 +0100 > > Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: > >>Does <> for generics fit into Pascal? Well, we use [] for array > >indexing, and () for parameter pass

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Bram Kuijvenhoven
Micha Nelissen wrote: On Mon, 07 Nov 2005 14:45:19 +0100 Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: Does <> for generics fit into Pascal? Well, we use [] for array indexing, and () for parameter passing to procedures/functions/methods. So why not use <> for passing parameters to generic type

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Micha Nelissen
On Mon, 07 Nov 2005 14:45:19 +0100 Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: > Does <> for generics fit into Pascal? Well, we use [] for array indexing, and > () for parameter passing to procedures/functions/methods. So why not use <> > for passing parameters to generic types? And, similar to

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Marco van de Voort
> Micha Nelissen wrote: > Consider for example the following: Is Java bad because it looks like C++? No. But it inherits from C syntax in nearly all forms. The test is consistency. Java is consistent if it follows C(++) syntax, (the rest of the language is C(++) like), (free)pascal not, > Or

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Bram Kuijvenhoven
Micha Nelissen wrote: Bram Kuijvenhoven wrote: Florian Klaempfl wrote: - we'll use a syntax as close as possible to Chrome, e.g. type TList = class ... end; I greatly favor this syntaxis above the generic-modifier. It will look at a lot more familiar to most programmers (due to e.g.

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Marco van de Voort
> Peter Vreman wrote: > TStringMyObjectMap = TMap; > > etc. > > One more question: If I understand it correctly, the parser uses a > recursive top-down recursive descent approach and not a bottom-up approach > like the LALR parsers generated by the pyacc tool? Correct. Pascal tools usually do.

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Bram Kuijvenhoven
Peter Vreman wrote: The token-lookahead is a hack and will create more problems and performance loss in a critical part of the compiler. The restriction of type blocks only is not strange at all, Delphi allows 'class of' is also only in type blocks Ok, I didn't know it would be a real ugly hac

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Micha Nelissen
Bram Kuijvenhoven wrote: Florian Klaempfl wrote: - we'll use a syntax as close as possible to Chrome, e.g. type TList = class ... end; I greatly favor this syntaxis above the generic-modifier. It will look at a lot more familiar to most programmers (due to e.g. C++ and Java), "Mu

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Peter Vreman
>> - instantiation will be only possible in declaration blocks, not in code >> blocks: >> possible: >> var >> mylist : TList; >> const >> mylist : TList = nil; >> type >> mylist = TList; >> forbidden: >> procedure p(mylist : TList); >> begin >> ... >> mylist:=TList.create; >> ... >> end

Re: [fpc-devel] Templates / Generics

2005-11-07 Thread Bram Kuijvenhoven
Hi! I've been following the generic discussion with great interest. Here are some of my thoughts. Florian Klaempfl wrote: - we'll use a syntax as close as possible to Chrome, e.g. type TList = class ... end; I greatly favor this syntaxis above the generic-modifier. It will look at a l

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread rstar
What is Chrome? Some examples of Generics: http://www.remobjects.com/articles/?id={A1D08EE3-0D9E-4828-AFB3-B2C1E772186E} ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Florian Klaempfl
dannym wrote: > hmm.. a parameter declaration of a function declaration is not a > declaration block ? I've always thought of them like local variables, > just happening to be pre-filled.. procedure p(a : array[0..10] of longint); isn't possible either. > > and, will TList and mylist be compati

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread dannym
Hi, Am Freitag, den 04.11.2005, 20:28 +0100 schrieb Florian Klaempfl: > I read the disussion above and I'll post my thoughts so far below: > > - we'll use a syntax as close as possible to Chrome, e.g. > type > TList = class > ... > end; > > - instantiation will be only possible in declar

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Micha Nelissen
On Fri, 04 Nov 2005 20:28:15 +0100 Florian Klaempfl <[EMAIL PROTECTED]> wrote: > - instantiation steps which require code generation are done after main > program compilation based on information saved in the unit files, this > has some advantages: If there are errors in some template, won't this

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Florian Klaempfl
I read the disussion above and I'll post my thoughts so far below: - we'll use a syntax as close as possible to Chrome, e.g. type TList = class ... end; - instantiation will be only possible in declaration blocks, not in code blocks: possible: var mylist : TList; const mylist : TList

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Peter Vreman
At 18:17 4-11-2005, you wrote: This is evaluated by the pre-compiler run during compile time. When you use the template with e.g. var bl: List; then procedure show(s:string) is taken. But what if the bl: List is called from an other unit? The Show(string) is then not visible anymore?

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread rstar
This is evaluated by the pre-compiler run during compile time. When you use the template with e.g. var bl: List; then procedure show(s:string) is taken. Peter Vreman wrote: Mattias Gaertner wrote: This page looks only like the start of a proposal. Neither complete nor official. Why

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Peter Vreman
> 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 gene

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 how/when

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Christian Iversen
On Friday 04 November 2005 10:33, Vinzent Hoefler wrote: > On Friday 04 November 2005 09:25, Micha Nelissen wrote: > > Marc Weustink wrote: > > > If the generic is "pre"compiled (which is maybe necesary if you > > > need access to privates) then I fear some runtime logic has to be > > > added to ca

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Peter Vreman
> Peter Vreman wrote: >> I did some tests with g++. It looks like it parses the template >> 'normally' >> and don't handle it like a macro. When instantiating the template the >> generic type is replaced. > > What tests did you do to come to this conclusion ? I mean, how can one > see how g++ parse

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Vinzent Hoefler
On Friday 04 November 2005 13:48, Vinzent Hoefler wrote: Stupid KMail. Deleted the text after file's eof. After the file there was supposed to be a remark about that the example does not compile as is, because generics in Ada are different from C++ templates, which are merely more like macros,

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 th

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Micha Nelissen
Peter Vreman wrote: I did some tests with g++. It looks like it parses the template 'normally' and don't handle it like a macro. When instantiating the template the generic type is replaced. What tests did you do to come to this conclusion ? I mean, how can one see how g++ parses things ? f

Re: [fpc-devel] Templates / Generics Syntax

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

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

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 p

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 ge

Re: [fpc-devel] Templates / Generics Syntax

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

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Vincent Snijders
Ales Katona wrote: 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 // gener

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Micha Nelissen
Ales Katona wrote: Are the () required? Why not TSomeList = TGenericList of Pointer; ? I guess, but in general one can use multiple generic types when coding a class, so this is to point out that it's ordered and defined. Micha ___ fpc-devel maill

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: type TGenericCollection = generic(T: TCollectionItem) class(TComponent) ...implement TCollection and use T end; TColl

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 Ales Katona
Micha Nelissen wrote: Marc Weustink wrote: BTW, what woud be the problem with type TMySpecificClass = TGenericClass(TObject, Integer); Or: type TGenericCollection = generic(T: TCollectionItem) class(TComponent) ...implement TCollection and use T end; TCollection = TGenericColl

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: > >>> > >>> > >>> >

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: type TGenericCollection = generic(T: TCollectionItem) class(TComponent) ...implement TCollection and use T end; TCollection = TGenericCollection of (TCollectionItem

Re: [fpc-devel] Templates / Generics Syntax

2005-11-04 Thread Marc Weustink
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: type TGenericClass = class public procedure Add(Item: T; Flag: F); end; This sy

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Mattias Gaertner
On Fri, 04 Nov 2005 08:38:03 +0100 [EMAIL PROTECTED] wrote: > Alexey Barkovoy wrote: > > >>> Delphi 11 .Net 2.0 will support Generics. Maybe Delphi 11 Win32. > >> > > > > > >> This page looks only like the start of a proposal. Neither complete nor > >> official. > >> Why do you think, that

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 > >> TGenericClass = class > >> public > >>procedure Add(Item: T; Flag: F)

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Micha Nelissen
Marc Weustink wrote: Micha Nelissen wrote: Marc Weustink wrote: case TypeInfo(Data) of StringType: Show(Data); IntegerType: Show(Data); end; The whole idea of Generics is to avoid this :-) I mean generated by the compiler, not by the "user" I understand, but I would be rathe

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 >> TGenericClass = class >> public >>procedure Add(Item: T; Flag: F); >> end; > > > This syntax is almost impossible to implement since in one of your other > mai

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 TGenericClass = 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 para

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Florian Klaempfl
Peter Vreman wrote: >>Mattias Gaertner wrote: >> >> >>>This page looks only like the start of a proposal. Neither complete nor >>>official. >>>Why do you think, that D2006 will have generics? >>> >>> >>> >> >>D2006 <> D11=D2007 > > > How will Delphi handle the following case with overloads and d

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Vinzent Hoefler
On Friday 04 November 2005 09:25, Micha Nelissen wrote: > Marc Weustink wrote: > > > If the generic is "pre"compiled (which is maybe necesary if you > > need access to privates) then I fear some runtime logic has to be > > added to call the correct procedure. IE. something like > > > > case TypeI

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Marc Weustink
Micha Nelissen wrote: Marc Weustink wrote: Peter Vreman wrote: How will Delphi handle the following case with overloads and different types: If the generic is "pre"compiled (which is maybe necesary if you need access to privates) then I fear some runtime logic has to be added to call the

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Micha Nelissen
Peter Vreman wrote: How will Delphi handle the following case with overloads and different types: The restriction to use generic types only in (assignment to)/(passing to procedure) of the same generic type is too big a restriction ? If you want to do this, one should instantiate it first ..

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Micha Nelissen
Marc Weustink wrote: Peter Vreman wrote: How will Delphi handle the following case with overloads and different types: If the generic is "pre"compiled (which is maybe necesary if you need access to privates) then I fear some runtime logic has to be added to call the correct procedure. IE. s

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Marc Weustink
Peter Vreman wrote: Mattias Gaertner wrote: This page looks only like the start of a proposal. Neither complete nor official. Why do you think, that D2006 will have generics? D2006 <> D11=D2007 How will Delphi handle the following case with overloads and different types: If it is han

Re: [fpc-devel] Templates / Generics

2005-11-04 Thread Peter Vreman
> Mattias Gaertner wrote: > >>This page looks only like the start of a proposal. Neither complete nor >>official. >>Why do you think, that D2006 will have generics? >> >> >> > > D2006 <> D11=D2007 How will Delphi handle the following case with overloads and different types: unit test; interfac

Re: [fpc-devel] Templates / Generics

2005-11-03 Thread Marco van de Voort
> Delphi 11 .Net 2.0 will support Generics. Maybe Delphi 11 Win32. > There is already proposal: > >http://qc.borland.com/wc/qcmain.aspx?d=11168 > > The FPC syntax must be at least a subset of the Borland syntax to be > compatible. Only if they are usuable for FPC. Delphi.NET has .NET 2.0

Re: [fpc-devel] Templates / Generics

2005-11-03 Thread rstar
Alexey Barkovoy wrote: Delphi 11 .Net 2.0 will support Generics. Maybe Delphi 11 Win32. This page looks only like the start of a proposal. Neither complete nor official. Why do you think, that D2006 will have generics? Not Delphi 2006, but Delphi 2007 __

Re: [fpc-devel] Templates / Generics

2005-11-03 Thread Alexey Barkovoy
Delphi 11 .Net 2.0 will support Generics. Maybe Delphi 11 Win32. This page looks only like the start of a proposal. Neither complete nor official. Why do you think, that D2006 will have generics? Not Delphi 2006, but Delphi 2007 ___ fpc-devel m

Re: [fpc-devel] Templates / Generics

2005-11-03 Thread rstar
Mattias Gaertner wrote: This page looks only like the start of a proposal. Neither complete nor official. Why do you think, that D2006 will have generics? D2006 <> D11=D2007 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists

Re: [fpc-devel] Templates / Generics

2005-11-03 Thread Mattias Gaertner
On Fri, 04 Nov 2005 01:06:42 +0100 [EMAIL PROTECTED] wrote: > Hi *, > Delphi 11 .Net 2.0 will support Generics. Maybe Delphi 11 Win32. > There is already proposal: > >http://qc.borland.com/wc/qcmain.aspx?d=11168 > > The FPC syntax must be at least a subset of the Borland syntax to be > com

Re: [fpc-devel] Templates / Generics

2005-11-03 Thread rstar
Hi *, Delphi 11 .Net 2.0 will support Generics. Maybe Delphi 11 Win32. There is already proposal: http://qc.borland.com/wc/qcmain.aspx?d=11168 The FPC syntax must be at least a subset of the Borland syntax to be compatible. Mattias Gaertner wrote: Hi all, I want to push generics to th

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 thi

Re: [fpc-devel] Templates / Generics Syntax

2005-11-03 Thread Peter Vreman
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 about edged brackets? > > > > type > > TGenericClass[T,F] = class > > public

  1   2   >