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] win32 patch for threads

2005-11-04 Thread Florian Klaempfl
Ales Katona wrote: > This patch fixes a bug in win32 threads. Warning: created in win32 :) > (no idea about lineendings) Aplied, also for wince and netware. > > Ales > > > > > Index: rtl/win32/tthread.inc >

[fpc-devel] Threads patch PS

2005-11-04 Thread Ales Katona
I forgot to mention it's against 2.0.1 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

[fpc-devel] win32 patch for threads

2005-11-04 Thread Ales Katona
This patch fixes a bug in win32 threads. Warning: created in win32 :) (no idea about lineendings) Ales Index: rtl/win32/tthread.inc === --- rtl/win32/tthread.inc (revision 1647) +++ rtl/win32/tthread.inc (working copy) @

Re: [fpc-devel] OpenGL and glut bugs in Freepascal 2.1.1runningwith Mac Os X Tiger ?

2005-11-04 Thread Jonas Maebe
On 04 Nov 2005, at 22:23, Matthias Krenzer wrote: 1.) Why are the fpc applications running fine after running some open gl applications written in c ? (maybe i didn't get it yet, sorry) Since we don't know what the bug in the Carbon framework is, that's hard to guess. And for some people,

Re: [fpc-devel] OpenGL and glut bugs in Freepascal 2.1.1runningwith Mac Os X Tiger ?

2005-11-04 Thread Matthias Krenzer
- Original Message - From: "Adriaan van Os" <[EMAIL PROTECTED]> To: "FPC developers' list" Sent: Thursday, November 03, 2005 10:48 AM Subject: Re: [fpc-devel] OpenGL and glut bugs in Freepascal 2.1.1runningwith Mac Os X Tiger ? Nexus wrote: An unhandled exception occurred at $9

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] GetAppConfigDir under Unices

2005-11-04 Thread dannym
Hi, Am Freitag, den 04.11.2005, 17:26 +0100 schrieb Michael Van Canneyt: > > On Fri, 4 Nov 2005, dannym wrote: > > > Hi, > > > > Am Freitag, den 04.11.2005, 05:46 +0100 schrieb Michalis Kamburelis: > >> Hi > >> > >> I just tested SysUtils.GetAppConfigDir under Linux and I see that it > >> return

Re: [fpc-devel] GetAppConfigDir under Unices

2005-11-04 Thread Michael Van Canneyt
On Fri, 4 Nov 2005, dannym wrote: Hi, Am Freitag, den 04.11.2005, 05:46 +0100 schrieb Michalis Kamburelis: Hi I just tested SysUtils.GetAppConfigDir under Linux and I see that it returns GetHomeDir + ApplicationName (when Global = false). Shouldn't it rather return GetHomeDir + '.' +

Re: [fpc-devel] GetAppConfigDir under Unices

2005-11-04 Thread dannym
Hi, Am Freitag, den 04.11.2005, 05:46 +0100 schrieb Michalis Kamburelis: > Hi > > I just tested SysUtils.GetAppConfigDir under Linux and I see that it > returns >GetHomeDir + ApplicationName > (when Global = false). Shouldn't it rather return >GetHomeDir + '.' + ApplicationName > ? Confi

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] Does FPC support XML encoding ?

2005-11-04 Thread Sebastian Günther
Alexander Todorov schrieb: > Hi all, > does fpc xml support encoding ??? > I have a document with > > > and an application which runs on a system with CP1251 locale. The text > is read from the xml file but is not properly shown. > How can I make it show properly ??? Actually the XML reader igno

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] Thread support for windows ?

2005-11-04 Thread Florian Klaempfl
Alexander Todorov wrote: > Hi, > what is the CThreads unit replacement in Windows > Do I need to use thread driver under Win32 or it is needed only for Linux? cthreads is only needed on unix. ___ fpc-devel maillist - fpc-devel@lists.freepascal.or

[fpc-devel] Thread support for windows ?

2005-11-04 Thread Alexander Todorov
Hi, what is the CThreads unit replacement in Windows Do I need to use thread driver under Win32 or it is needed only for Linux? TIA. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

[fpc-devel] Does FPC support XML encoding ?

2005-11-04 Thread Alexander Todorov
Hi all, does fpc xml support encoding ??? I have a document with and an application which runs on a system with CP1251 locale. The text is read from the xml file but is not properly shown. How can I make it show properly ??? Delphi does this automatically ? TIA __

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] Re: Templates / Generics Syntax

2005-11-04 Thread Mattias Gaertner
On Fri, 04 Nov 2005 12:56:03 +0100 Thomas Schatzl <[EMAIL PROTECTED]> 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; > > > > > > Th

[fpc-devel] Re: Templates / Generics Syntax

2005-11-04 Thread Thomas Schatzl
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 parameters appear in regular

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