Re: [fpc-pascal] Generics Syntax

2014-02-28 Thread Michael Schnell
On 02/27/2014 11:41 PM, silvioprog wrote: that wonderful unit! Any chance to include it in the fpc svn ? -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
..Continuing the never ending discussion ... [ In one ore more other threads here I showed that (IMHO) it would be most sensible (and in fact not performance killing (!) ) way out of the multiple (statically defined) "new" String types with different encoding (with auto-conversion) to addition

[fpc-pascal] Announces & License question

2014-02-28 Thread Yann Mérignac
Hi, I have released some free pascal code. - *data2pas* a command line tool that generates pascal include files from a text file description. This is a tool similar to *data2inc* but using a more "pascalish" syntax. (GPL v3+) http://yann.merignac.free.fr/data2pas.html - *CmdLine*

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Reinier Olislagers
On 28/02/2014 11:11, Yann Mérignac wrote: > All units are under LGPL v3+ but I am not sure of my choice. I want the > units to be usable by anyone in any kind of projects : closed source or > not, commercial or not, etc... And, I want that any change to the source > of the units mustbe made public.

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Jonas Maebe
On 28 Feb 2014, at 11:11, Yann Mérignac wrote: - *data2pas* a command line tool that generates pascal include files from a text file description. This is a tool similar to *data2inc* but using a more "pascalish" syntax. (GPL v3+) http://yann.merignac.free.fr/data2pas.html - *CmdLin

Re: [fpc-pascal] How to use generics and meta class?

2014-02-28 Thread Joao Morais
Em 27/02/14 19:56, luiz americo pereira camara escreveu: 2014-02-27 18:43 GMT-03:00 Joao Morais >: Correct. The feature I was talking about is something like: generic TMyGeneric And TMyType is a class. In this case the compiler knows I am talk

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Reinier Olislagers
On 28/02/2014 11:45, Reinier Olislagers wrote: > On 28/02/2014 11:11, Yann Mérignac wrote: >> All units are under LGPL v3+ but I am not sure of my choice. I want the >> units to be usable by anyone in any kind of projects : closed source or >> not, commercial or not, etc... And, I want that any cha

Re: [fpc-pascal] How to use generics and meta class?

2014-02-28 Thread Joao Morais
Em 28/02/14 03:44, Sven Barth escreveu: === code end === Currently this will print: === output begin === Bar === output end === If the compiler would now naively generate an implementation of TMyGeneric with TMyType then the result would be: === output begin === Foo === output end ===

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Tomas Hajny
On Fri, February 28, 2014 11:45, Reinier Olislagers wrote: > On 28/02/2014 11:11, Yann Mérignac wrote: >> All units are under LGPL v3+ but I am not sure of my choice. I want the >> units to be usable by anyone in any kind of projects : closed source or >> not, commercial or not, etc... And, I want

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Yann Mérignac
Ok. So I will release new versions with licenses changed to GPL v3 + linking exception. Thanks to all. 2014-02-28 11:49 GMT+01:00 Jonas Maebe : > > On 28 Feb 2014, at 11:11, Yann Mérignac wrote: > >- *data2pas* a command line tool that generates pascal include files >> from a text file de

Re: [fpc-pascal] Property attributes

2014-02-28 Thread Joao Morais
Em 27/02/14 09:34, Sven Barth escreveu: Am 27.02.2014 11:56, schrieb Joao Morais: Em 27/02/14 05:26, Sven Barth escreveu: Am 27.02.2014 01:38, schrieb Joao Morais: Hello list. What is the current status of property attributes? Some roadmap? http://wiki.freepascal.org/Property_attributes Th

Re: [fpc-pascal] List published properties of a class

2014-02-28 Thread Joao Morais
Em 09/02/14 18:05, Joao Morais escreveu: Hello list. I need to list all published properties declared in a class, iow, removing properties inherited from the parent. Up to now I am iterating typinfo.GetPropList, starting at: GetTypeData(PTypeInfo(TheClass.ClassParent.ClassInfo))^.PropCount;

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Marco van de Voort
In our previous episode, Yann M?rignac said: > Ok. So I will release new versions with licenses changed to GPL v3 + > linking exception. I would do gplv2+ + linking exception, since that makes it more compatible to FPC, and the risk on Tivoisation is that great in this case.

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Sven Barth
Am 28.02.2014 09:37 schrieb "Michael Schnell" : > > ..Continuing the never ending discussion ... > > [ In one ore more other threads here I showed that (IMHO) it would be most sensible (and in fact not performance killing (!) ) way out of the multiple (statically defined) "new" String types with di

Re: [fpc-pascal] How to use generics and meta class?

2014-02-28 Thread Sven Barth
Am 28.02.2014 12:07 schrieb "Joao Morais" : > > Em 28/02/14 03:44, Sven Barth escreveu: > >> >> === code end === >> >> Currently this will print: >> >> === output begin === >> >> Bar >> >> === output end === >> >> If the compiler would now naively generate an implementation of TMyGeneric with TMyTy

Re: [fpc-pascal] List published properties of a class

2014-02-28 Thread Sven Barth
Am 28.02.2014 12:33 schrieb "Joao Morais" : > > Em 09/02/14 18:05, Joao Morais escreveu: > >> >> Hello list. I need to list all published properties declared in a class, iow, removing properties inherited from the parent. >> >> Up to now I am iterating typinfo.GetPropList, starting at: >> >> GetTyp

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Jonas Maebe
On 28 Feb 2014, at 12:44, Marco van de Voort wrote: In our previous episode, Yann M?rignac said: Ok. So I will release new versions with licenses changed to GPL v3 + linking exception. I would do gplv2+ + linking exception, since that makes it more compatible to FPC, At least all of our

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Marco van de Voort
In our previous episode, Sven Barth said: > Problem: there is (currently) no string type that can handle ANSI, UTF-8 > and UTF-16 at once. The first two are handled by AnsiString and the third > by UnicodeString. And those two are not equal which would be important for > overrides/overloads/inherit

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Marco van de Voort
In our previous episode, Jonas Maebe said: > > I would do gplv2+ + linking exception, since that makes it more > > compatible to > > FPC, > > At least all of our own source code is (L)GPL2+, so it shouldn't cause > problems. Not compatible to our license, but compatible to being included in

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > Here, The Delphi model does not provide a String encoding type (and > appropriate "compiler magic") that can be used for that purpose (i.e. > "fully dynamically encoded"). > > Hence the fpc team _might_ decide to enhance the Delphi imposed model

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Sven Barth
Am 28.02.2014 14:16, schrieb Michael Schnell: On 02/28/2014 12:53 PM, Sven Barth wrote: Problem: there is (currently) no string type that can handle ANSI, UTF-8 and UTF-16 at once. The first two are handled by AnsiString and the third by UnicodeString. And those two are not equal which would

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 12:53 PM, Sven Barth wrote: Problem: there is (currently) no string type that can handle ANSI, UTF-8 and UTF-16 at once. The first two are handled by AnsiString and the third by UnicodeString. And those two are not equal which would be important for overrides/overloads/inheritan

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 01:04 PM, Marco van de Voort wrote: Moreover, will operations that use character access make sense at all if you don't know what the actual encoding is? The administrative record of each "New Delphi string" contains the encoding type and the byte-count for each code. So "you" (the

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Sven Barth
Am 28.02.2014 15:01, schrieb Michael Schnell: On 02/28/2014 01:04 PM, Marco van de Voort wrote: Moreover, will operations that use character access make sense at all if you don't know what the actual encoding is? The administrative record of each "New Delphi string" contains the encoding type

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > > Moreover, will operations that use character access make sense at all > > if you don't know what the actual encoding is? > The administrative record of each "New Delphi string" contains the > encoding type and the byte-count for each code. So "y

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 02:26 PM, Marco van de Voort wrote: I think it is better to start implementing it in a fork. A fork can move much faster and make a reconnaissance of all problems and find solutions for them, and see what you can do to improve compatibility. One the fork has a functioning Lazarus

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 03:08 PM, Sven Barth wrote: It is possible as some mails a few months back have shown. If you have a function that has a RawByteString return type then you can assign that to a string of any static encoding even if the dynamic encoding is not the same (and then static and dynamic

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 03:09 PM, Marco van de Voort wrote: Yes, but the point is that the programmer that writes the index into the delete() might not oversee all cases. You are absolutely right. But since Unicode is usable in Strings, a "normal programmer" is not really allowed to "write an index" i

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > > > Well, the trick is not to leave that to chance. > > I don't understand. When using Lazarus (if it stays similar to what it > is now) your strings will be UTF8. If pos() requires UTF16 you are out > of luck. Fixing that in Lazarus is easier t

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 03:00 PM, Sven Barth wrote: As long as not stated differently AnsiString and UnicodeString are meant as implemented in FPC trunk. Can you point me to a _final_ documentation on this ? Here, The Delphi model does not provide a String encoding type (and appropriate "compiler magic"

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 03:37 PM, Marco van de Voort wrote: Fixing that in Lazarus is easier than implementing your case in the compiler. Maybe. (Mseide shows how this can be done even without "New Delphi Strings"). But in many discussions I learned that the Lazarus team is not at all happy with the

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > I see that trying different kinds of "Delphi compatibility plus > OS-independence" (which obviously is a contradiction in itself) makes a > lot of sense for the fpc / Lazarus combination. I don't really see it. I'm not even sure if I would like it

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 04:07 PM, Marco van de Voort wrote: If you have a working proof of concept ... As this would need some (even if not much) compiler magic, I will never be able to provide something like this. Here the help of someone who understands the internal working of the compiler is necessary

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 04:07 PM, Marco van de Voort wrote: a bit like MSEGUI's Martin Schreiber? No. AFAIK, MSEGUI uses the fpc compiler out of the box and "only" provides an alternate library and IDE. Martin did draft a new fpc-alike compiler (as discussed in his mailing list) but he declined to i

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Michael Schnell
On 02/28/2014 04:07 PM, Marco van de Voort wrote: single source two releases, or two source two releases? Hmm. I suppose also compiler magic is affected and thus the compiler would needed to be re-compiled for either release. -Michael ___ fpc-pasca

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Sven Barth
Am 28.02.2014 15:24, schrieb Michael Schnell: On 02/28/2014 03:08 PM, Sven Barth wrote: It is possible as some mails a few months back have shown. If you have a function that has a RawByteString return type then you can assign that to a string of any static encoding even if the dynamic encodin

Re: [fpc-pascal] Generic String Functions

2014-02-28 Thread Sven Barth
Am 28.02.2014 15:42, schrieb Michael Schnell: On 02/28/2014 03:00 PM, Sven Barth wrote: As long as not stated differently AnsiString and UnicodeString are meant as implemented in FPC trunk. Can you point me to a _final_ documentation on this ? Work on final documentation will be started when 2.

Re: [fpc-pascal] How to use generics and meta class?

2014-02-28 Thread silvioprog
2014-02-28 8:57 GMT-03:00 Sven Barth : > Am 28.02.2014 12:07 schrieb "Joao Morais" : > Guys, I added your names in an TdGStorage demo: https://github.com/silvioprog/dopf/blob/master/demos/storage/demo1.lpr (y) -- Silvio Clécio My public projects - github.com/silvioprog

[fpc-pascal] Enum scope

2014-02-28 Thread Marcos Douglas
Hi, The FPC stable version allow to declare a new type, as private/protected/public, inside a class. So, I propose migrate enums to your "own" classes... why? Well, I have my own TProcess so TMyProcess inherit from TProcess. Perfectly. But I need to use some properties like: Property Options

Re: [fpc-pascal] Enum scope

2014-02-28 Thread Mattias Gaertner
On Fri, 28 Feb 2014 15:29:03 -0300 Marcos Douglas wrote: >[...] > These properties are defined in Process unit. My class is in myprocess unit > (or something like that). > The problem is: I can not use the enums values because they don't exists in > my unit (myprocess) but if these enums were def

Re: [fpc-pascal] Enum scope

2014-02-28 Thread Marcos Douglas
On Fri, Feb 28, 2014 at 3:47 PM, Mattias Gaertner wrote: > > On Fri, 28 Feb 2014 15:29:03 -0300 > Marcos Douglas wrote: > > >[...] > > These properties are defined in Process unit. My class is in myprocess unit > > (or something like that). > > The problem is: I can not use the enums values becau

Re: [fpc-pascal] Enum scope

2014-02-28 Thread Sven Barth
On 28.02.2014 19:59, Marcos Douglas wrote: On Fri, Feb 28, 2014 at 3:47 PM, Mattias Gaertner wrote: On Fri, 28 Feb 2014 15:29:03 -0300 Marcos Douglas wrote: [...] These properties are defined in Process unit. My class is in myprocess unit (or something like that). The problem is: I can not

Re: [fpc-pascal] Enum scope

2014-02-28 Thread Marcos Douglas
On Fri, Feb 28, 2014 at 4:22 PM, Sven Barth wrote: > On 28.02.2014 19:59, Marcos Douglas wrote: >> >> On Fri, Feb 28, 2014 at 3:47 PM, Mattias Gaertner >> wrote: >>> >>> >>> On Fri, 28 Feb 2014 15:29:03 -0300 >>> Marcos Douglas wrote: >>> [...] These properties are defined in Process u

Re: [fpc-pascal] Announces & License question

2014-02-28 Thread Yann Mérignac
Compatibility with FPC and avoid the proliferation of licenses... 2 good arguments in favor of GPL v2+ + linking exception. I'll go that way. Thanks 2014-02-28 13:10 GMT+01:00 Marco van de Voort : > In our previous episode, Jonas Maebe said: > > > I would do gplv2+ + linking exception, since th