Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > symtable > > > > Mean? > > > > (it is at the end of a method) > > You are accessing a symbol that's defined in the static symtable > (implementation section of the unit). Does that code compile with > Delphi? If so then please report a bug... I was

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Jorge Aldo G. de F. Junior
http://theory.stanford.edu/~amitp/rants/c++-vs-c/ found the thing... its not a book and C++ has no generics but templates (for me both are the same, im no C++ programmer). Now reading it again... The thing is that a quicksort in C can be fast only if used for one single type (at least the compari

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Sven Barth
Am 15.02.2012 15:45, schrieb Marco van de Voort: In our previous episode, Sven Barth said: Note that I mostly reacted to the sentiment it wouldn't be needed at all. I directly agree it is not the highest prio in the generics implementation. I saw you recently fixed some of my bugs, I'll do a n

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > > > Note that I mostly reacted to the sentiment it wouldn't be needed at all. I > > directly agree it is not the highest prio in the generics implementation. > > > > I saw you recently fixed some of my bugs, I'll do a new run. > > Yes, do that please.

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Sven Barth
Am 15.02.2012 15:09, schrieb michael.vancann...@wisa.be: On Wed, 15 Feb 2012, Sven Barth wrote: Am 15.02.2012 14:09, schrieb michael.vancann...@wisa.be: On Wed, 15 Feb 2012, Sven Barth wrote: Am 14.02.2012 22:28, schrieb Marco van de Voort: In our previous episode, Sven Barth said: Afa

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread michael . vancanneyt
On Wed, 15 Feb 2012, Sven Barth wrote: Am 15.02.2012 14:09, schrieb michael.vancann...@wisa.be: On Wed, 15 Feb 2012, Sven Barth wrote: Am 14.02.2012 22:28, schrieb Marco van de Voort: In our previous episode, Sven Barth said: Afaik it was the main reason to implement generic constraints

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Sven Barth
Am 15.02.2012 14:15, schrieb Marco van de Voort: In our previous episode, Sven Barth said: Let's first implement everything that we need to have full Delphi compatibilty (generic methods, constraints, inline specializations in more complicated expressions) and then we can think of optimizing the

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Sven Barth
Am 15.02.2012 14:09, schrieb michael.vancann...@wisa.be: On Wed, 15 Feb 2012, Sven Barth wrote: Am 14.02.2012 22:28, schrieb Marco van de Voort: In our previous episode, Sven Barth said: Afaik it was the main reason to implement generic constraints in Delphi (like .NET)? Constraints allow

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Marco van de Voort
In our previous episode, Sven Barth said: > Let's first implement everything that we need to have full Delphi > compatibilty (generic methods, constraints, inline specializations in > more complicated expressions) and then we can think of optimizing the > generic implementation for cases like cl

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread michael . vancanneyt
On Wed, 15 Feb 2012, Sven Barth wrote: Am 14.02.2012 22:28, schrieb Marco van de Voort: In our previous episode, Sven Barth said: Afaik it was the main reason to implement generic constraints in Delphi (like .NET)? Constraints allow the compiler to infer further information on the given t

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Sven Barth
Am 14.02.2012 22:28, schrieb Marco van de Voort: In our previous episode, Sven Barth said: Afaik it was the main reason to implement generic constraints in Delphi (like .NET)? Constraints allow the compiler to infer further information on the given types to improve e.g. type checking when pars

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread ik
On Wed, Feb 15, 2012 at 11:19, Juha Manninen wrote: > 2012/2/15, Jorge Aldo G. de F. Junior : >> i once read a textbook about generics (C++ generics) showing how C++ > > C++ does not have generics, it has templates. Templates syntax is > complex, you can do actual programming with it. IMO, using a

Re: [fpc-pascal] Re: TLinkedList

2012-02-15 Thread Juha Manninen
2012/2/15, Jorge Aldo G. de F. Junior : > i once read a textbook about generics (C++ generics) showing how C++ C++ does not have generics, it has templates. Templates syntax is complex, you can do actual programming with it. IMO, using all its capacity leads to over-engineered and unreadable code.

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread Jorge Aldo G. de F. Junior
i once read a textbook about generics (C++ generics) showing how C++ code can end up being FASTER than C equivalent due to lack of type checks... it uses a quick sort routing as example. on C you end up having to check the type of storage to get a similar result, while on C++ you check this at ru

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > Afaik it was the main reason to implement generic constraints in Delphi > > (like > > .NET)? > > Constraints allow the compiler to infer further information on the given > types to improve e.g. type checking when parsing the generic, Exactly. You e.

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread Sven Barth
On 14.02.2012 22:03, Marco van de Voort wrote: In our previous episode, Sven Barth said: in a container, the same container could be used. Such logic unnecessarily complicates the compiler. Generics are already troublesome enough. Afaik it was the main reason to implement generic constraints

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread Sven Barth
On 14.02.2012 21:38, Carver413 wrote: As long as one knows of the disadvantages of generics there is no problem in enjoying their advantages. the disadvantage will come in the useing. over time more and more units will contain these because they are easy. so you will end up with a lot of redu

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > in a container, the same container could be used. > > Such logic unnecessarily complicates the compiler. Generics are already > troublesome enough. Afaik it was the main reason to implement generic constraints in Delphi (like .NET)? _

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread Sven Barth
On 14.02.2012 19:33, Juha Manninen wrote: 2012/2/14, Sven Barth: Am 14.02.2012 06:45, schrieb Carver413: doesn't generics more or less duplicate the class every time you use it with different type, and if so would this not cause alot of bloating ? Yes it does. So for embedded systems "use wit

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread Juha Manninen
2012/2/14, Sven Barth : > Am 14.02.2012 06:45, schrieb Carver413: >> doesn't generics more or less duplicate the class every time you use it >> with >> different type, and if so would this not cause alot of bloating ? > > Yes it does. So for embedded systems "use with care" ;) Oh, that is bad! C+

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread Sven Barth
Am 14.02.2012 06:45, schrieb Carver413: doesn't generics more or less duplicate the class every time you use it with different type, and if so would this not cause alot of bloating ? Yes it does. So for embedded systems "use with care" ;) Regards, Sven ___

Re: [fpc-pascal] Re: TLinkedList

2012-02-14 Thread ik
On Tue, Feb 14, 2012 at 07:45, Carver413 wrote: > > doesn't generics more or less duplicate the class every time you use it > with > different type, and if so would this not cause alot of bloating ? > ‎That's one of the things that I'm afraid of actually. > > > > __

Re: [fpc-pascal] Re: TLinkedList

2012-02-11 Thread Juha Manninen
2012/2/11, Jorge Aldo G. de F. Junior : > I believe generics makes faster code due to having no need to test > types during runtime... i maybe wrong. It is true only if you use the type-safe "as" casting. Normal casting does not check types at runtime. It does make the code more readable. Like:

Re: [fpc-pascal] Re: TLinkedList

2012-02-11 Thread Jorge Aldo G. de F. Junior
I believe generics makes faster code due to having no need to test types during runtime... i maybe wrong. 2012/2/11 ik : > On Fri, Feb 10, 2012 at 17:53, leledumbo wrote: >> >> I don't remember having that since 2.X.X... there was always TList, >> however. >> And that's what I was using (I use ge

Re: [fpc-pascal] Re: TLinkedList

2012-02-11 Thread ik
On Fri, Feb 10, 2012 at 17:53, leledumbo wrote: > I don't remember having that since 2.X.X... there was always TList, > however. > And that's what I was using (I use generics for all my containers use now). > Thanks. Personally I dislike generics at all. They are not that readable imho. Even tho