Re: [fpc-devel] Generics Basics

2005-11-13 Thread John Briggs
On Fri, Nov 11, 2005 at 08:50:09AM +0100, Micha Nelissen wrote: > John Briggs wrote: > >The one thing that does concern me is why implement generics if you fail > >to implement the late binding of the objects which to me is the greatest > >gain of > >generic programming. > > What is "late bindin

Re: [fpc-devel] Generics Basics

2005-11-13 Thread Jonas Maebe
On 11 Nov 2005, at 08:50, Micha Nelissen wrote: What is "late binding" exactly ? What are you binding ? Late binding means that the compiler doesn't have to be able to figure out at compile time whether or not a particular object understands a particular message (aka has a method with a p

Re: [fpc-devel] Generics Basics

2005-11-11 Thread dannym
Hi, Am Donnerstag, den 10.11.2005, 20:24 +1100 schrieb 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

Re: [fpc-devel] Generics Basics

2005-11-10 Thread Micha Nelissen
John Briggs wrote: The one thing that does concern me is why implement generics if you fail to implement the late binding of the objects which to me is the greatest gain of generic programming. Speed. What is "late binding" exactly ? What are you binding ? Micha

Re: [fpc-devel] Generics Basics

2005-11-10 Thread Jonas Maebe
On 10 Nov 2005, at 10:24, John Briggs wrote: To me generics should essentially make FPC a typeless language. i.e. everthing is an object and you just pass messages between objects, ala Smalltalk. How it is implemented is a moot point because at the top level you shouldn't be able to see t

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

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-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-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 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 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 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: 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-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: Re[2]: [fpc-devel] Generics Basics

2005-11-08 Thread Marco van de Voort
> I didn't discuss about this idea but now I would say something. Is it > really important, to integrate templates support into compiler? Yes. Otherwise they are no templates. > Maybe an external preprocessing utility should be better? IMHO this can't be done. E.g. the avoiding of multiple insta

Re[2]: [fpc-devel] Generics Basics

2005-11-08 Thread 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 preprocessor can slow the compiling process very much even if a 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 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 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 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 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 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 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

[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