Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-01

Generics basic library

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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.

I was thinking on the lines of: TGenericList<T> = class

Does something similar already exist?

If not, maybe I can find some time to write something to start with. Any ideas about unit name, location on fpc sources, if it's useful at all, what it should contain, etc, for that?

thanks,

Felipe Monteiro de Carvalho

Reply by email

Graeme Geldenhuys
to Felipe Monteiro de Carvalho

Hi Felipe,

I have never gotten onto the band wagon regarding Generics. I have only seen the word being tossed around on the mailing lists and newsgroups. Do you maybe have a nice link explaining Generics, what benefits it has over TList (TObjectList and friends) and what I would use it for? I gather FPC 2.2.0 has support for Generics?

Regards,
- Graeme -

Felipe Monteiro de Carvalho wrote 23 lines
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. I was thinking on the lines of: TGenericList<T> = class Does something similar already exist? If not, maybe I can find some time to write something to start with. Any ideas about unit name, location on fpc sources, if it's useful at all, what it should contain, etc, for that? thanks, -- Felipe Monteiro de Carvalho _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel
Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Peter Vreman
you wrote 15 lines
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. I was thinking on the lines of: TGenericList<T> = class Does something similar already exist? If not, maybe I can find some time to write something to start with. Any ideas about unit name, location on fpc sources, if it's useful at all, what it should contain, etc, for that?

See the fgl unit in current 2.2.1 or 2.3.1. Generics were not stable enough in the past to have the unit already enabled in 2.2.0.

Peter

Reply by email

Peter Vreman
to Graeme Geldenhuys: I have never gotten onto the band wagon regarding Generics. I have only seen the word…
you wrote 7 lines
Hi Felipe, I have never gotten onto the band wagon regarding Generics. I have only seen the word being tossed around on the mailing lists and newsgroups. Do you maybe have a nice link explaining Generics, what benefits it has over TList (TObjectList and friends) and what I would use it for? I gather FPC 2.2.0 has support for Generics?

FPC 2.2.0 has alpha quality generics that is not usable in real world. Current FPC 2.2.1 and 2.3.1 have beta quality with some known issues (see mantis).

Peter

Reply by email

Felipe Monteiro de Carvalho
to Peter Vreman: See the fgl unit in current 2.2.1 or 2.3.1. Generics were not stable enough in the past…
Peter Vreman wrote
See the fgl unit in current 2.2.1 or 2.3.1. Generics were not stable enough in the past to have the unit already enabled in 2.2.0.

Oh, thanks. In my search I had actually found this unit, but then I looked at the unit name and said: Oh, pretty cool they are using generics on the opengl bindings, but doesn't help me much =)

Felipe Monteiro de Carvalho

Reply by email