[fpc-devel] generics

2005-04-27 Thread Danny Milosavljevic
Hi, I'm trying to add support for generics (templates) to fpc. Do we want to have a "generics" section (like "interface", "implementation") or do we want a special source code type (like "unit", "program") in the source code ? I'm tending to a special source code type "generic unit". The generi

[fpc-devel] Generics

2006-04-09 Thread rstar
It isn't clear to me what the current status about Generics is: http://www.freepascal.org/wiki/index.php/Generics Are they Delphi conform (.net2)? What's planned? Can somebody explain? ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://li

[fpc-devel] generics

2006-12-20 Thread Vincent Snijders
Will fpc support generic record declarations like this: type generic TFixedKeyNode = record key: array[0..KeySize-1] of char; value: dword; end; In other word the type is not parameterized by another type but by an integer used to define the upper limit of an array. I am thinking

[fpc-devel] Generics

2007-02-03 Thread ik
Hi All, I'm looking for a guide (for people that have slow learning curves like me ;)) regarding understanding generics, and the ability to start using them. Thanks, Ido -- http://ik.homelinux.org/ ___ fpc-devel maillist - fpc-devel@lists.freepasca

[fpc-devel] Generics

2007-08-16 Thread Mattias Gaertner
What is the state and future plans of generics? I only found the wiki page http://wiki.lazarus.freepascal.org/Generics which does not even mention the current syntax. Mattias ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.free

[fpc-devel] Generics collections

2016-07-29 Thread Dimitrios Chr. Ioannidis
Hi, is there a chance to merge the generics collections 34229 commit from trunk to 3.0 fixes ( a.k.a. 3.0.2 soon to be ) also ? regards, -- Dimitrios Chr. Ioannidis ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.o

Re: [fpc-devel] Generics

2009-10-21 Thread David B Copeland
On Wed, 2009-10-21 at 15:54 +0200, Jonas Maebe wrote: > On 21 Oct 2009, at 14:55, Marco van de Voort wrote: > > Generics still don't work 100%, > > > Jonas > In what way is Generics not 100%? Dave Copeland. ___ fpc-devel maillist - fpc-devel@

Re: [fpc-devel] Generics

2009-10-21 Thread Alexander Klenin
On Thu, Oct 22, 2009 at 04:08, David B Copeland wrote: > In what way is Generics not 100%? > > Dave Copeland. For me at least, the gravest problem is a lack of function-level generics. -- Alexander S. Klenin ___ fpc-devel maillist - fpc-devel@lists.

Re: [fpc-devel] Generics

2009-10-22 Thread Jonas Maebe
On 21 Oct 2009, at 19:08, David B Copeland wrote: On Wed, 2009-10-21 at 15:54 +0200, Jonas Maebe wrote: Generics still don't work 100%, In what way is Generics not 100%? There are problems with using inheritance, e.g. http://bugs.freepascal.org/view.php?id=12249 and http://svn.freepascal

[fpc-devel] Generics problem

2010-05-25 Thread Andrew Brunner
I've just encountered a generics problem and wanted to know if it was intentional... uGenerics.pas generic GObjectList<_T>=class(TList) private FIndex : integer; private function Get(Index:integer): _T; procedure Put(Index:integer; Item:_T); public constructor

Re: [fpc-devel] generics

2005-04-27 Thread rstar
further infos: http://qc.borland.com/wc/qcmain.aspx?d=11168 Danny Milosavljevic wrote: Hi, I'm trying to add support for generics (templates) to fpc. Do we want to have a "generics" section (like "interface", "implementation") or do we want a special source code type (like "unit", "program") in th

Re: [fpc-devel] generics

2005-04-27 Thread Peter Vreman
> Hi, > > I'm trying to add support for generics (templates) to fpc. > > Do we want to have a "generics" section (like "interface", > "implementation") or do we want a special source code type (like "unit", > "program") in the source code ? > > I'm tending to a special source code type "generic uni

Re: [fpc-devel] generics

2005-04-29 Thread Danny Milosavljevic
Hi, Am Donnerstag, den 28.04.2005, 07:53 +0200 schrieb Peter Vreman: > > Hi, > > > > I'm trying to add support for generics (templates) to fpc. > > > > Do we want to have a "generics" section (like "interface", > > "implementation") or do we want a special source code type (like "unit", > > "progr

Re: [fpc-devel] generics

2005-04-29 Thread Peter Vreman
At 18:06 29-4-2005, you wrote: Hi, Am Donnerstag, den 28.04.2005, 07:53 +0200 schrieb Peter Vreman: > > Hi, > > > > I'm trying to add support for generics (templates) to fpc. > > > > Do we want to have a "generics" section (like "interface", > > "implementation") or do we want a special source code

Re: [fpc-devel] generics

2005-05-02 Thread Danny Milosavljevic
hi, Am Freitag, den 29.04.2005, 21:48 +0200 schrieb Peter Vreman: > At 18:06 29-4-2005, you wrote: > >Hi, > > > >Am Donnerstag, den 28.04.2005, 07:53 +0200 schrieb Peter Vreman: > > > > Hi, > > > > > > > > I'm trying to add support for generics (templates) to fpc. > > > > > > > > Do we want to hav

Re: [fpc-devel] generics

2005-05-02 Thread Peter Vreman
> hi, > > Am Freitag, den 29.04.2005, 21:48 +0200 schrieb Peter Vreman: >> At 18:06 29-4-2005, you wrote: >> >Hi, >> > >> >Am Donnerstag, den 28.04.2005, 07:53 +0200 schrieb Peter Vreman: >> > > > Hi, >> > > > >> > > > I'm trying to add support for generics (templates) to fpc. >> > > > >> > > > Do

Re: [fpc-devel] generics

2005-05-02 Thread Danny Milosavljevic
Hi, Am Montag, den 02.05.2005, 17:56 +0200 schrieb Peter Vreman: > > hi, > > > > Am Freitag, den 29.04.2005, 21:48 +0200 schrieb Peter Vreman: > >> At 18:06 29-4-2005, you wrote: > >> >Hi, > >> > > >> >Am Donnerstag, den 28.04.2005, 07:53 +0200 schrieb Peter Vreman: > >> > > > Hi, > >> > > > > >>

[fpc-devel] Generics Basics

2005-11-08 Thread Felipe Monteiro de Carvalho
Hello, I am trying to understand what exactly generics are. I read the wiki page, but there are lot's of code examples and very few explanations. Can someone explain it to me in a (relatively) simple way? What problem is it trying to solve? And how do generics relate to interfaces? thanks, Fel

Re: [fpc-devel] Generics

2006-04-09 Thread Florian Klaempfl
[EMAIL PROTECTED] wrote: > It isn't clear to me what the current status about Generics is: > http://www.freepascal.org/wiki/index.php/Generics 2.1.1 contains pre alpha code, they aren't usable yet.. It is subject to be finished with 2.2. > Are they Delphi conform Is there already a specificatio

Re: [fpc-devel] Generics

2006-04-09 Thread rstar
Florian Klaempfl wrote: Is there already a specification how they will look like in Delphi? I think no. But there is already a specification for C#. I guess the Delphi syntax won't be differ to much from the C# definition: http://qc.borland.com/wc/qcmain.aspx?d=11168

Re: [fpc-devel] Generics

2006-04-09 Thread Flávio Etrusco
On 4/9/06, Florian Klaempfl <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > (...) > Is there already a specification how they will look like in Delphi? > > > (.net2)? What's planned? Can somebody explain? > > > > They are more like C++ templates. What? Do you mean that FPC implementation o

Re: [fpc-devel] Generics

2006-04-09 Thread Marco van de Voort
> What? Do you mean that FPC implementation of generics wouldn't be > based on "type erasure" but on beefed-up-precompiler-macros? Please > say I got it all wrong :-o Do you have documents about "type erasure" in native languages where e.g. a string is not an object ? _

Re: [fpc-devel] Generics

2006-04-09 Thread rstar
sts.freepascal.org/mailman/listinfo/fpc-devel Generics are "type safe". ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] Generics

2006-04-09 Thread Florian Klaempfl
Flávio Etrusco wrote: > On 4/9/06, Florian Klaempfl <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> (...) >> Is there already a specification how they will look like in Delphi? >> >>> (.net2)? What's planned? Can somebody explain? >>> >> They are more like C++ templates. > > What? Do you

Re: [fpc-devel] Generics

2006-04-09 Thread Flávio Etrusco
On 4/9/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: > > What? Do you mean that FPC implementation of generics wouldn't be > > based on "type erasure" but on beefed-up-precompiler-macros? Please > > say I got it all wrong :-o > > Do you have documents about "type erasure" in native languages wh

Re: [fpc-devel] Generics

2006-04-09 Thread Florian Klaempfl
Flávio Etrusco wrote: > On 4/9/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: >>> What? Do you mean that FPC implementation of generics wouldn't be >>> based on "type erasure" but on beefed-up-precompiler-macros? Please >>> say I got it all wrong :-o >> Do you have documents about "type erasure"

Re: [fpc-devel] Generics

2006-04-09 Thread Marco van de Voort
> On 4/9/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: > > > What? Do you mean that FPC implementation of generics wouldn't be > > > based on "type erasure" but on beefed-up-precompiler-macros? Please > > > say I got it all wrong :-o > > > > Do you have documents about "type erasure" in native

Re: [fpc-devel] Generics

2006-04-09 Thread Flávio Etrusco
On 4/9/06, Florian Klaempfl <[EMAIL PROTECTED]> wrote: > Flávio Etrusco wrote: > > On 4/9/06, Florian Klaempfl <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: > >> (...) > >> Is there already a specification how they will look like in Delphi? > >> > >>> (.net2)? What's planned? Can somebod

Re: [fpc-devel] Generics

2006-04-09 Thread Marco van de Voort
> > > What? Do you mean that FPC implementation of generics wouldn't be > > > based on "type erasure" but on beefed-up-precompiler-macros? Please > > > say I got it all wrong :-o > > > > You want crippled generics regarding speed and usage like C# has? You > > can do this with "real" templates as w

Re: [fpc-devel] Generics

2006-04-09 Thread Florian Klaempfl
Flávio Etrusco wrote: > On 4/9/06, Florian Klaempfl <[EMAIL PROTECTED]> wrote: >> Flávio Etrusco wrote: >>> On 4/9/06, Florian Klaempfl <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: (...) Is there already a specification how they will look like in Delphi? > (.net2)? Wh

Re: [fpc-devel] Generics

2006-04-09 Thread Marco van de Voort
> > I guess I was a bit too hasty on the whining, but just thinking about > > C++ compilation speed > > What compiler? If gcc, gcc does nothing fast, and C++ header model than the > bit of codegenerating done. nothing fast ..., _the problem is more_ ... C++ header model __

Re: [fpc-devel] Generics

2006-04-09 Thread Flávio Etrusco
I hope I'm not being too annoying, I'm just trying to understand better your decision/opinion. If you think this discussion is useless please speak and I'll shut up ;-) > Well, talking about Java's speed never makes sense. LOL, I agree :-) > Fact is, if you use > classes that you've always an in

Re: [fpc-devel] Generics

2006-04-09 Thread Flávio Etrusco
On 4/9/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: > > > I guess I was a bit too hasty on the whining, but just thinking about > > > C++ compilation speed > > > > What compiler? If gcc, gcc does nothing fast, and C++ header model than the > > bit of codegenerating done. > > nothing fast ...,

Re: [fpc-devel] Generics

2006-04-09 Thread Marco van de Voort
> > > What compiler? If gcc, gcc does nothing fast, and C++ header model than > > > the > > > bit of codegenerating done. > > > > nothing fast ..., _the problem is more_ ... C++ header model > > VisualC++ 6. > I know it's much related to C header model and linking, but I never > saw any "comp

Re: [fpc-devel] Generics

2006-04-10 Thread Danny Milosavljevic
Hi, Am Sonntag, den 09.04.2006, 18:51 -0300 schrieb Flávio Etrusco: > I hope I'm not being too annoying, I'm just trying to understand > better your decision/opinion. If you think this discussion is useless > please speak and I'll shut up ;-) > > > Well, talking about Java's speed never makes sen

Re: [fpc-devel] Generics

2006-04-10 Thread Flávio Etrusco
On 4/10/06, Danny Milosavljevic <[EMAIL PROTECTED]> wrote: > Hi, > (...) > > but thing is I can't see much use for generics for low level > > tasks. > > You need them for any kind of compile-time-type-checked collections... > so as long as you only do I/O port programming, you are safe... no wait,

Re: [fpc-devel] Generics

2006-04-11 Thread Marco van de Voort
> Templates' pros: > - support of primitive types; > - flexibility (ability to call non-virtual and non-related methods, > operators, etc); > - ability of coding for speed. > > Type erasure generics' pros: > - No additional generated code, no code bloat; > - Code is easier to understand (no addi

Re: [fpc-devel] Generics

2006-04-11 Thread Micha Nelissen
On Mon, 10 Apr 2006 23:33:12 -0300 "Flávio Etrusco" <[EMAIL PROTECTED]> wrote: > Type erasure generics' pros: What does type erasure mean without a runtime engine (VM) ? Micha ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freep

Re: [fpc-devel] Generics

2006-04-11 Thread Flávio Etrusco
On 4/11/06, Micha Nelissen <[EMAIL PROTECTED]> wrote: > On Mon, 10 Apr 2006 23:33:12 -0300 > "Flávio Etrusco" <[EMAIL PROTECTED]> wrote: > > > Type erasure generics' pros: > > What does type erasure mean without a runtime engine (VM) ? > That the "template" is not aware of the instantiated type of

Re: [fpc-devel] Generics

2006-04-11 Thread Micha Nelissen
On Tue, 11 Apr 2006 13:06:27 -0300 "Flávio Etrusco" <[EMAIL PROTECTED]> wrote: > > What does type erasure mean without a runtime engine (VM) ? > > That the "template" is not aware of the instantiated type of the > template parameters, they are only accessed/resolved through oop > (inheritance/pol

Re: [fpc-devel] Generics

2006-04-11 Thread Flávio Etrusco
On 4/11/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: > > > Templates' pros: > > - support of primitive types; > > - flexibility (ability to call non-virtual and non-related methods, > > operators, etc); > > - ability of coding for speed. > > > > Type erasure generics' pros: > > - No additional

Re: [fpc-devel] Generics

2006-04-11 Thread Danny Milosavljevic
Hi, Am Montag, den 10.04.2006, 23:33 -0300 schrieb Flávio Etrusco: > On 4/10/06, Danny Milosavljevic <[EMAIL PROTECTED]> wrote: > > Hi, > > > (...) > > > but thing is I can't see much use for generics for low level > > > tasks. > > > > You need them for any kind of compile-time-type-checked collec

Re: [fpc-devel] Generics

2006-04-11 Thread Flávio Etrusco
On 4/11/06, Danny Milosavljevic <[EMAIL PROTECTED]> wrote: > Hi, > > Am Montag, den 10.04.2006, 23:33 -0300 schrieb Flávio Etrusco: > > On 4/10/06, Danny Milosavljevic <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > (...) > > > > but thing is I can't see much use for generics for low level > > > > t

Re: [fpc-devel] Generics

2006-04-11 Thread Peter Vreman
> On 4/11/06, Marco van de Voort <[EMAIL PROTECTED]> wrote: >> >> > Templates' pros: >> > - support of primitive types; >> > - flexibility (ability to call non-virtual and non-related methods, >> > operators, etc); >> > - ability of coding for speed. >> > >> > Type erasure generics' pros: >> > - No

Re: [fpc-devel] Generics

2006-04-12 Thread Danny Milosavljevic
Hi, Am Dienstag, den 11.04.2006, 18:56 -0300 schrieb Flávio Etrusco: > On 4/11/06, Danny Milosavljevic <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Am Montag, den 10.04.2006, 23:33 -0300 schrieb Flávio Etrusco: > > > On 4/10/06, Danny Milosavljevic <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > > >

Re: [fpc-devel] Generics

2006-04-12 Thread Bisma Jayadi
It isn't clear to me what the current status about Generics is: http://www.freepascal.org/wiki/index.php/Generics http://www.dummzeuch.de/delphi/object_pascal_templates/english.html http://community.borland.com/article/0,1410,27603,00.html -Bee- has Bee.ography at http://beeography.wordpress.

Re: [fpc-devel] Generics

2006-04-12 Thread Micha Nelissen
On Wed, 12 Apr 2006 08:31:58 +0200 (CEST) "Peter Vreman" <[EMAIL PROTECTED]> wrote: > FPC is a compiled language where not all types are classes. The only way > to implement it is like C++ templates. It is a known fact that generics > will introduce code bloat, but that is still less than the 15-2

Re: [fpc-devel] Generics

2006-04-12 Thread Flávio Etrusco
On 4/12/06, Bisma Jayadi <[EMAIL PROTECTED]> wrote: > > It isn't clear to me what the current status about Generics is: > > http://www.freepascal.org/wiki/index.php/Generics > > http://www.dummzeuch.de/delphi/object_pascal_templates/english.html > > http://community.borland.com/article/0,1410,27603

Re: [fpc-devel] Generics

2006-04-12 Thread Bisma Jayadi
It isn't clear to me what the current status about Generics is: http://www.freepascal.org/wiki/index.php/Generics http://www.dummzeuch.de/delphi/object_pascal_templates/english.html http://community.borland.com/article/0,1410,27603,00.html Ingenious! I really feel stupid for not thinking of s

Re: [fpc-devel] Generics

2006-04-13 Thread Jonas Maebe
On 13 apr 2006, at 00:29, Flávio Etrusco wrote: http://www.dummzeuch.de/delphi/object_pascal_templates/english.html http://community.borland.com/article/0,1410,27603,00.html Ingenious! I really feel stupid for not thinking of something that simple like this before :-) Something similar is

Re: [fpc-devel] Generics

2006-04-13 Thread Marc Weustink
Flávio Etrusco wrote: On 4/12/06, Bisma Jayadi <[EMAIL PROTECTED]> wrote: It isn't clear to me what the current status about Generics is: http://www.freepascal.org/wiki/index.php/Generics http://www.dummzeuch.de/delphi/object_pascal_templates/english.html http://community.borland.com/article

Re: [fpc-devel] Generics

2006-04-13 Thread Daniël Mantione
Op Thu, 13 Apr 2006, schreef Marc Weustink: > > Ingenious! I really feel stupid for not thinking of something that > > simple like this before :-) > > Is it possible this way to "derive" 2 (or more) classes in one unit from the > same generic ? The matrix unit does it. It uses FPC's preprocess

Re: [fpc-devel] Generics

2006-04-13 Thread Vincent Snijders
Marc Weustink wrote: Flávio Etrusco wrote: On 4/12/06, Bisma Jayadi <[EMAIL PROTECTED]> wrote: It isn't clear to me what the current status about Generics is: http://www.freepascal.org/wiki/index.php/Generics http://www.dummzeuch.de/delphi/object_pascal_templates/english.html http://commu

Re: [fpc-devel] generics

2006-12-20 Thread Daniël Mantione
Op Wed, 20 Dec 2006, schreef Vincent Snijders: > Will fpc support generic record declarations like this: > > type > generic TFixedKeyNode = record > key: array[0..KeySize-1] of char; > value: dword; > end; > > In other word the type is not parameterized by another type but by an integer > us

Re: [fpc-devel] generics

2006-12-20 Thread Vincent Snijders
Daniël Mantione schreef: Op Wed, 20 Dec 2006, schreef Vincent Snijders: Will fpc support generic record declarations like this: type generic TFixedKeyNode = record key: array[0..KeySize-1] of char; value: dword; end; In other word the type is not parameterized by another type but by an int

Re: [fpc-devel] generics

2006-12-20 Thread Michael Schnell
Will fpc support generic record declarations like this: type generic TFixedKeyNode = record key: array[0..KeySize-1] of char; value: dword; end; In other word the type is not parameterized by another type but by an integer used to define the upper limit of an array. Free Pascal

Re: [fpc-devel] generics

2006-12-20 Thread Daniël Mantione
Op Wed, 20 Dec 2006, schreef Vincent Snijders: > Daniël Mantione schreef: > > > > Op Wed, 20 Dec 2006, schreef Vincent Snijders: > > > > > Will fpc support generic record declarations like this: > > > > > > type > > > generic TFixedKeyNode = record > > > key: array[0..KeySize-1] of char; > >

Re: [fpc-devel] generics

2006-12-20 Thread Marco van de Voort
> Op Wed, 20 Dec 2006, schreef Vincent Snijders: > > > > > In other word the type is not parameterized by another type but by an > > integer > > used to define the upper limit of an array. > > Basically, isn't this similar to a schema type like you have in Extended > Pascal? Aren't those autom

Re: [fpc-devel] generics

2006-12-20 Thread Daniël Mantione
Op Wed, 20 Dec 2006, schreef Marco van de Voort: > > Op Wed, 20 Dec 2006, schreef Vincent Snijders: > > > > > > > > In other word the type is not parameterized by another type but by an > > > integer > > > used to define the upper limit of an array. > > > > Basically, isn't this similar to a

Re: [fpc-devel] generics

2006-12-20 Thread Marco van de Voort
> Op Wed, 20 Dec 2006, schreef Marco van de Voort: > > > > In other word the type is not parameterized by another type but by an > > > > integer > > > > used to define the upper limit of an array. > > > > > > Basically, isn't this similar to a schema type like you have in Extended > > > Pascal? >

Re: [fpc-devel] generics

2006-12-20 Thread Daniël Mantione
Op Wed, 20 Dec 2006, schreef Marco van de Voort: > > Op Wed, 20 Dec 2006, schreef Marco van de Voort: > > > > > In other word the type is not parameterized by another type but by an > > > > > integer > > > > > used to define the upper limit of an array. > > > > > > > > Basically, isn't this si

Re: [fpc-devel] generics

2006-12-21 Thread Michael Schnell
No. Generics are more like using a macro when defining a type. So a ":=" copies the memory and not a pointer and they are passed by value into a procedure. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org

Re: [fpc-devel] generics

2006-12-21 Thread Vincent Snijders
Michael Schnell schreef: No. Generics are more like using a macro when defining a type. So a ":=" copies the memory and not a pointer and they are passed by value into a procedure. I think you cut too much context. To which question does this give an answer? Vincent __

Re: [fpc-devel] generics

2006-12-21 Thread Michael Schnell
Michael Schnell schreef: No. Generics are more like using a macro when defining a type. So a ":=" copies the memory and not a pointer and they are passed by value into a procedure. I think you cut too much context. To which question does this give an answer? (Don't you see the link to t

Re: [fpc-devel] Generics

2007-08-16 Thread Michael Van Canneyt
On Thu, 16 Aug 2007, Mattias Gaertner wrote: > > What is the state and future plans of generics? > I only found the wiki page > > http://wiki.lazarus.freepascal.org/Generics > > which does not even mention the current syntax. The current syntax is descibed in the docs, reference manual. Ther

Re: [fpc-devel] Generics

2007-08-16 Thread Jesus Reyes
--- Michael Van Canneyt <[EMAIL PROTECTED]> escribió: > > > On Thu, 16 Aug 2007, Mattias Gaertner wrote: > > > > > What is the state and future plans of generics? > > I only found the wiki page > > > > http://wiki.lazarus.freepascal.org/Generics > > > > which does not even mention the curre

Re: [fpc-devel] Generics

2007-08-16 Thread Jesus Reyes
--- Jesus Reyes <[EMAIL PROTECTED]> escribió: > > --- Michael Van Canneyt <[EMAIL PROTECTED]> escribió: > > > > > > > On Thu, 16 Aug 2007, Mattias Gaertner wrote: > > > > > > > > What is the state and future plans of generics? > > > I only found the wiki page > > > > > > http://wiki.lazaru

Re: [fpc-devel] Generics

2007-08-16 Thread Michael Van Canneyt
On Thu, 16 Aug 2007, Jesus Reyes wrote: > > --- Michael Van Canneyt <[EMAIL PROTECTED]> escribió: > > > > > > > On Thu, 16 Aug 2007, Mattias Gaertner wrote: > > > > > > > > What is the state and future plans of generics? > > > I only found the wiki page > > > > > > http://wiki.lazarus.fre

Re: [fpc-devel] Generics

2007-08-16 Thread Mattias Gaertner
On Thu, 16 Aug 2007 14:59:47 -0500 (CDT) Jesus Reyes <[EMAIL PROTECTED]> wrote: > > --- Jesus Reyes <[EMAIL PROTECTED]> escribió: > > > > > --- Michael Van Canneyt <[EMAIL PROTECTED]> escribió: > > > > > > > > > > > On Thu, 16 Aug 2007, Mattias Gaertner wrote: > > > > > > > > > > > What is

Re: [fpc-devel] Generics

2007-08-16 Thread Michael Van Canneyt
On Thu, 16 Aug 2007, Mattias Gaertner wrote: > On Thu, 16 Aug 2007 14:59:47 -0500 (CDT) > Jesus Reyes <[EMAIL PROTECTED]> wrote: > > > > > --- Jesus Reyes <[EMAIL PROTECTED]> escribió: > > > > > > > > --- Michael Van Canneyt <[EMAIL PROTECTED]> escribió: > > > > > > > > > > > > > > > On T

Re: [fpc-devel] Generics

2007-08-16 Thread Mattias Gaertner
On Thu, 16 Aug 2007 23:31:25 +0200 (CEST) Michael Van Canneyt <[EMAIL PROTECTED]> wrote: >[...] > > Why is the local variable block needed? > > It is not. I asked the same question. It was added for symmetry > reasons: if a local type block is allowed, then a var block should > also be allowed. >

Re: [fpc-devel] Generics

2007-08-17 Thread Florian Klaempfl
Mattias Gaertner schrieb: On Thu, 16 Aug 2007 23:31:25 +0200 (CEST) Michael Van Canneyt <[EMAIL PROTECTED]> wrote: [...] Why is the local variable block needed? It is not. I asked the same question. It was added for symmetry reasons: if a local type block is allowed, then a var block should a

Re: [fpc-devel] Generics

2007-08-17 Thread Michael Van Canneyt
On Fri, 17 Aug 2007, Florian Klaempfl wrote: > Mattias Gaertner schrieb: > > On Thu, 16 Aug 2007 23:31:25 +0200 (CEST) > > Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > > > > [...] > > > > Why is the local variable block needed? > > > It is not. I asked the same question. It was added for

Re: [fpc-devel] Generics

2007-08-17 Thread Florian Klaempfl
Michael Van Canneyt schrieb: On Fri, 17 Aug 2007, Florian Klaempfl wrote: Mattias Gaertner schrieb: On Thu, 16 Aug 2007 23:31:25 +0200 (CEST) Michael Van Canneyt <[EMAIL PROTECTED]> wrote: [...] Why is the local variable block needed? It is not. I asked the same question. It was added for

Re: [fpc-devel] Generics

2007-08-17 Thread Michael Van Canneyt
On Fri, 17 Aug 2007, Florian Klaempfl wrote: > Michael Van Canneyt schrieb: > > > > On Fri, 17 Aug 2007, Florian Klaempfl wrote: > > > > > Mattias Gaertner schrieb: > > > > On Thu, 16 Aug 2007 23:31:25 +0200 (CEST) > > > > Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > > > > > > > > [...]

Re: [fpc-devel] Generics

2007-08-17 Thread Mattias Gaertner
On Fri, 17 Aug 2007 10:20:13 +0200 (CEST) Michael Van Canneyt <[EMAIL PROTECTED]> wrote: >[...] > > > > > What local types are/will be allowed? > > > > > > > > > > For example, this is currently not allowed: > > > > > > > > > > generic TTree = class(TObject) > > > > > type public TTreeNode =

Re: [fpc-devel] Generics

2007-08-17 Thread Micha Nelissen
Mattias Gaertner wrote: For example, this is currently not allowed: generic TTree = class(TObject) type public TTreeNode = specialize TNode; end; Shouldn't this be allowed? Perhaps it can only work with a complete TTreeNode description, probably the TNode is specific for use by T

Re: [fpc-devel] Generics

2007-08-17 Thread Bram Kuijvenhoven
Florian Klaempfl wrote: Mattias Gaertner schrieb: For example, this is currently not allowed: generic TTree = class(TObject) type public TTreeNode = specialize TNode; end; And this neither: generic TTree = class(TObject) type public TTreeNode = class Data: T; end;

[fpc-devel] Generics syntax error

2010-09-22 Thread Felipe Monteiro de Carvalho
Hello, Has anyone experienced issues with generics? I have the following code: unit cdescreen; {$mode delphi} interface uses // LCL, RTL, FCL Classes, SysUtils, Controls, Graphics, LCLType, SDFData, fpimage, fgl, // cdeconfig, cdeprovinces, cdeutils, cdegame, cdetypes, dlgstatus; ty

[fpc-devel] Generics, TObject Descendant?

2015-02-18 Thread Den
Hi there, Currently this code: TSomeObject = Class; TSomeOtherObject = Class(TSomeObject ); And finally: TMyObject = Class; TSomeOtherOtherObject = Class(TSomeOtherObject ); Comes up with error 'got "T" expected "TObject"' .. But TMyObject is based off of TObject? - Dennis

Re: [fpc-devel] Generics collections

2016-07-30 Thread Maciej Izak
Impossible! :O *Finally*! Thanks Sven! Totally unexpected event. ;) I'd like to use Generics.Collections in stable release ASAP but... IMO best version for release is 3.2 (even 3.0.4 is probably to early). I need to review latest changes in trunk for generics to correct library (package?) code, be

Re: [fpc-devel] Generics collections

2016-07-30 Thread Sven Barth
Am 30.07.2016 18:10 schrieb "Maciej Izak" : > > Impossible! :O *Finally*! Thanks Sven! Totally unexpected event. ;) Expect the unexpected :P > I'd like to use Generics.Collections in stable release ASAP but... IMO best version for release is 3.2 (even 3.0.4 is probably to early). I need to review

Re: [fpc-devel] Generics collections

2016-07-31 Thread Maciej Izak
2016-07-30 18:40 GMT+02:00 Sven Barth : > please check the changes I've made (they're mentioned both in the commit > as well as the issue). > > merged into github repo > Maybe you should add an "experimental" modifier to these types so that one > knows that they're unstable. > I've made that lon

[fpc-devel] Generics basic library

2008-01-17 Thread Felipe Monteiro de Carvalho
Hello, I was coding and I suddently saw that need to use a typed list. I went with TFPList, but considering we already have compiler support I thougth that maybe we could have a basic library with useful classes using generics. I searched on fpc 2.2.0 sources a lot, but I couldn't find anything.

Re: [fpc-devel] Generics Basics

2005-11-08 Thread L505
>Hello, > >I am trying to understand what exactly generics are. I read the wiki >page, but there are lot's of code examples and very few explanations. >Can someone explain it to me in a (relatively) simple way? > >What problem is it trying to solve? > >And how do generics relate to interfaces? I

Re: [fpc-devel] Generics Basics

2005-11-08 Thread dannym
Hi, Am Dienstag, den 08.11.2005, 18:10 -0200 schrieb Felipe Monteiro de Carvalho: > Hello, > > I am trying to understand what exactly generics are. I read the wiki > page, but there are lot's of code examples and very few explanations. > Can someone explain it to me in a (relatively) simple way?

Re: [fpc-devel] Generics Basics

2005-11-08 Thread Christian Iversen
On Tuesday 08 November 2005 21:33, L505 wrote: > >Hello, > > > >I am trying to understand what exactly generics are. I read the wiki > >page, but there are lot's of code examples and very few explanations. > >Can someone explain it to me in a (relatively) simple way? > > > >What problem is it tryin

Re: [fpc-devel] Generics Basics

2005-11-08 Thread L505
> > The Very Big Advantage (Tm), is that you get syntax checking, while still > using a type diversely. That's impossible to do (at compile-time) without > generics. > > Probably the best example of this is something like TList: > > Without generics: > > TOrange = class ... end; > TApple = class

Re: [fpc-devel] Generics Basics

2005-11-08 Thread Marc Weustink
L505 wrote: The Very Big Advantage (Tm), is that you get syntax checking, while still using a type diversely. That's impossible to do (at compile-time) without generics. Probably the best example of this is something like TList: Without generics: TOrange = class ... end; TApple = class ... en

Re: [fpc-devel] Generics Basics

2005-11-08 Thread rstar
dannym wrote: Hi, Am Dienstag, den 08.11.2005, 18:10 -0200 schrieb Felipe Monteiro de Carvalho: Hello, I am trying to understand what exactly generics are. I read the wiki page, but there are lot's of code examples and very few explanations. Can someone explain it to me in a (relatively) s

Re: [fpc-devel] Generics Basics

2005-11-08 Thread Felipe Monteiro de Carvalho
I´m starting to like generics, specially for this: > (as a side note, note the only reason why anybody bothers with type safe > compiled languages is strong type checking, that is total _compile time_ > strong type checking, also known as "if it compiles, it works (mostly)". > If it weren't for th

Re: [fpc-devel] Generics Basics

2005-11-08 Thread Daniël Mantione
Op Wed, 9 Nov 2005, schreef Pavel V. Ozerski: > Hello all, > I didn't discuss about this idea but now I would say something. Is it > really important, to integrate templates support into compiler? Maybe > an external preprocessing utility should be better? I think, an > integrated complex prepro

Re: [fpc-devel] Generics Basics

2005-11-09 Thread Bram Kuijvenhoven
Daniël Mantione wrote: Ok, lets put it blunt. It is absolutely not important to have templates at all. We've been able to develop top class code of the best kind without templates. That is true. Yet I really like the type-safety of templates. Advantages include: - you have to type less type c

Re: [fpc-devel] Generics Basics

2005-11-09 Thread Daniël Mantione
Op Wed, 9 Nov 2005, schreef Bram Kuijvenhoven: > Daniël Mantione wrote: > (Ok, maybe I'm exaggerating a little bit, but don't you agree generics /are/ > useful?) Certainly I do agree. However, they *will* be used to introduce the bloated programming I described. I don't think we should be hap

Re: [fpc-devel] Generics Basics

2005-11-09 Thread Bram Kuijvenhoven
Daniël Mantione wrote: Op Wed, 9 Nov 2005, schreef Bram Kuijvenhoven: Daniël Mantione wrote: (Ok, maybe I'm exaggerating a little bit, but don't you agree generics /are/ useful?) Certainly I do agree. However, they *will* be used to introduce the bloated programming I described. I don't think

Re: [fpc-devel] Generics Basics

2005-11-09 Thread Marco van de Voort
> Dani?l Mantione wrote: > >>Won't the compiler sometimes be able to handle this smarter? When the code > >>generated for vector and vector is equivalent, we only > >>need > >>to include it once in the resulting executable, right? The only thing is we > >>have to see when this situation occurs. >

Re: [fpc-devel] Generics Basics

2005-11-09 Thread Daniël Mantione
Op Wed, 9 Nov 2005, schreef Bram Kuijvenhoven: > > These tricks have been used in some C++ compilers with very limited > > success. The problem is that class_a has a different virtual > > methods/constructors/destructors than class b, so the code to be > > generated for them will be different, e

Re: [fpc-devel] Generics Basics

2005-11-09 Thread rstar
Daniël Mantione wrote: But... Templates can save typing. People are demanding them, because there is a hype. Lack of templates is seen as a deficiency of Pascal against C++. So we should support them. Daniël Agreed. I have a 2000 lines unit containing type safe lists that would become 300

Re: [fpc-devel] Generics Basics

2005-11-10 Thread Peter Vreman
>> There's a big risk involved with templates; code bloat. Namely, with >> templates, you can instantiate classes without realising that you are >> adding tens of kilobytes of code. >> >> I.e. in C++ if you instantiate a vector, vector, >> vector, you have three implementations of the vector in you

Re: [fpc-devel] Generics Basics

2005-11-10 Thread John Briggs
On Tue, Nov 08, 2005 at 10:00:49PM +0100, dannym wrote: > Hi, > > Am Dienstag, den 08.11.2005, 18:10 -0200 schrieb Felipe Monteiro de > Carvalho: > > Hello, > > > > I am trying to understand what exactly generics are. I read the wiki > > page, but there are lot's of code examples and very few exp

  1   2   >