Re: [fpc-pascal] [HOW TO] Create a shared object (SO) with FP

2011-04-22 Thread Jilani Khaldi
On 22/04/2011 22.36, Sven Barth wrote: On 22.04.2011 18:31, Jilani Khaldi wrote: {$linklib c} uses dynlibs; procedure hello(const x: double); cdecl; external 'libmylib.so'; var lHandle: TLibHandle; v: double; begin lHandle := LoadLibrary('./libmylib.so'); if lHandle <> nilHandle then begin v

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Marco van de Voort
In our previous episode, michael.vancann...@wisa.be said: > >>> IMHO it is the long term solution. Anything else would be madness, or > >>> minor > >>> damage control at best. > >> > >> Most of the more "recent" or "new" languages I know do not have generics, > > > > What do you mean, C++,C#, Java

Re: [fpc-pascal] [HOW TO] Create a shared object (SO) with FP

2011-04-22 Thread Sven Barth
On 22.04.2011 18:31, Jilani Khaldi wrote: {$linklib c} uses dynlibs; procedure hello(const x: double); cdecl; external 'libmylib.so'; var lHandle: TLibHandle; v: double; begin lHandle := LoadLibrary('./libmylib.so'); if lHandle <> nilHandle then begin v := 3.14159; hello(v); end else writeln('

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Michael Van Canneyt
On Fri, 22 Apr 2011, Žilvinas Ledas wrote: On 2011-04-22 20:05, Michael Van Canneyt wrote: IMO a helper is bound closer to a type than an operator. Please explain ? To my understanding, they're on exactly the same level ? (from a language feature point of view). I mean, what can be more

Re: [fpc-pascal] [HOW TO] Create a shared object (SO) with FP

2011-04-22 Thread Jilani Khaldi
You do not have the library path on the system LD_LIBRARY_PATH variable or at the ldconfig path. I have set it manually and it works. How to set it inside "fpc.cfg" file? BTW, why don't you load it dynamically instead of statically if you are going the next mile to test it. How to do this? Th

Re: [fpc-pascal] [HOW TO] Create a shared object (SO) with FP

2011-04-22 Thread ik
On Fri, Apr 22, 2011 at 19:31, Jilani Khaldi wrote: > {$linklib c} > > uses > dynlibs; > > procedure hello(const x: double); cdecl; external 'libmylib.so'; > > var > lHandle: TLibHandle; > v: double; > begin > lHandle := LoadLibrary('./libmylib.so'); > if lHandle <> nilHandle then > begin >

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Žilvinas Ledas
On 2011-04-22 20:05, Michael Van Canneyt wrote: IMO a helper is bound closer to a type than an operator. Please explain ? To my understanding, they're on exactly the same level ? (from a language feature point of view). I mean, what can be more close to a type than a := operator ? From

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Michael Van Canneyt
On Fri, 22 Apr 2011, Florian Klämpfl wrote: Am 22.04.2011 14:01, schrieb michael.vancann...@wisa.be: By this rule, the helper class/operator/beast you proposed in the other mail should also not be available, because it is not known during definition. Just as a helper is 'attached' to a type

[fpc-pascal] [HOW TO] Create a shared object (SO) with FP

2011-04-22 Thread Jilani Khaldi
{$linklib c} uses dynlibs; procedure hello(const x: double); cdecl; external 'libmylib.so'; var lHandle: TLibHandle; v: double; begin lHandle := LoadLibrary('./libmylib.so'); if lHandle <> nilHandle then begin v := 3.14159; hello(v); end else writeln('Cannot load "myli

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 14:01, schrieb michael.vancann...@wisa.be: > > By this rule, the helper class/operator/beast you proposed in the other > mail > should also not be available, because it is not known during definition. > > Just as a helper is 'attached' to a type, an operator is equally > 'attached'

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Sven Barth
On 22.04.2011 16:51, Žilvinas Ledas wrote: On 2011-04-22 14:47, michael.vancann...@wisa.be wrote: On Fri, 22 Apr 2011, Marco van de Voort wrote: In our previous episode, michael.vancann...@wisa.be said: class for each storage type and deal with delegation overhead. I've complete understand

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Žilvinas Ledas
On 2011-04-22 14:47, michael.vancann...@wisa.be wrote: On Fri, 22 Apr 2011, Marco van de Voort wrote: In our previous episode, michael.vancann...@wisa.be said: class for each storage type and deal with delegation overhead. I've complete understanding for the fact that generics are too earl

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread michael . vancanneyt
On Fri, 22 Apr 2011, Florian Klämpfl wrote: Am 22.04.2011 12:58, schrieb Sven Barth: No. He can define a record helper operator. The question is simple: do we want generics behave like macros or more like .Net generics. Some hybrid approach is imo wrong. Before I forget it: Why do you think

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread michael . vancanneyt
On Fri, 22 Apr 2011, Florian Klämpfl wrote: Am 22.04.2011 13:32, schrieb michael.vancann...@wisa.be: On Fri, 22 Apr 2011, Florian Klämpfl wrote: (I suspect this is why it is possible to add type restrictions in the Delphi/.Net implementations) 2. If I have my own overloaded version of

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread michael . vancanneyt
On Fri, 22 Apr 2011, Marco van de Voort wrote: In our previous episode, michael.vancann...@wisa.be said: class for each storage type and deal with delegation overhead. I've complete understanding for the fact that generics are too early, but IMHO it is the long term solution. Anything else w

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 13:32, schrieb michael.vancann...@wisa.be: > > > On Fri, 22 Apr 2011, Florian Klämpfl wrote: > >>>(I suspect this is why it is possible to add type restrictions in the >>> Delphi/.Net implementations) >>> >>> 2. If I have my own overloaded version of '+' for a record, the above

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread michael . vancanneyt
On Fri, 22 Apr 2011, Florian Klämpfl wrote: (I suspect this is why it is possible to add type restrictions in the Delphi/.Net implementations) 2. If I have my own overloaded version of '+' for a record, the above means that it cannot ever be used for generics, while it will be used for

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 12:36, schrieb Sven Barth: > > Oh dear... I have completely forgotton about operators in record helpers > in my implementation... That's the problem with every new language feature: the complexity of the compiler probably increases not with O(n) but something between O(n) and O(n^2

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 12:58, schrieb Sven Barth: >> No. He can define a record helper operator. The question is simple: do >> we want generics behave like macros or more like .Net generics. Some >> hybrid approach is imo wrong. > > Before I forget it: Why do you think that a hybrid approach is wrong? I m

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Sven Barth
On 22.04.2011 12:18, Florian Klämpfl wrote: Am 22.04.2011 12:06, schrieb michael.vancann...@wisa.be: On Fri, 22 Apr 2011, Florian Klämpfl wrote: mya.pp(16,12) Error: Operator is not overloaded: "complex" + "complex" myb.pp(9,14) Fatal: There were 1 errors compiling module, stopping Which is

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Marco van de Voort
In our previous episode, michael.vancann...@wisa.be said: > > class for each storage type and deal with delegation overhead. > > > > I've complete understanding for the fact that generics are too early, but > > IMHO it is the long term solution. Anything else would be madness, or minor > > damage c

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Sven Barth
On 22.04.2011 12:36, Sven Barth wrote: On 22.04.2011 12:18, Florian Klämpfl wrote: Am 22.04.2011 12:06, schrieb michael.vancann...@wisa.be: On Fri, 22 Apr 2011, Florian Klämpfl wrote: mya.pp(16,12) Error: Operator is not overloaded: "complex" + "complex" myb.pp(9,14) Fatal: There were 1 err

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Sven Barth
On 22.04.2011 12:18, Florian Klämpfl wrote: Am 22.04.2011 12:06, schrieb michael.vancann...@wisa.be: On Fri, 22 Apr 2011, Florian Klämpfl wrote: mya.pp(16,12) Error: Operator is not overloaded: "complex" + "complex" myb.pp(9,14) Fatal: There were 1 errors compiling module, stopping Which is

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Sven Barth
On 22.04.2011 11:23, Florian Klämpfl wrote: Am 22.04.2011 00:31, schrieb Michael Van Canneyt: On Thu, 21 Apr 2011, Sven Barth wrote: On 21.04.2011 21:45, Michael Van Canneyt wrote: On Thu, 21 Apr 2011, Marco van de Voort wrote: In our previous episode, Michael Van Canneyt said: You ca

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 11:32, schrieb Sven Barth: > On 22.04.2011 11:23, Florian Klämpfl wrote: >> Am 22.04.2011 00:31, schrieb Michael Van Canneyt: >>> >>> >>> On Thu, 21 Apr 2011, Sven Barth wrote: >>> On 21.04.2011 21:45, Michael Van Canneyt wrote: > > > On Thu, 21 Apr 2011, Marco van de

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 12:06, schrieb michael.vancann...@wisa.be: > > > On Fri, 22 Apr 2011, Florian Klämpfl wrote: > >>> mya.pp(16,12) Error: Operator is not overloaded: "complex" + "complex" >>> myb.pp(9,14) Fatal: There were 1 errors compiling module, stopping >>> >>> Which is strange to say the least

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread michael . vancanneyt
On Fri, 22 Apr 2011, Sven Barth wrote: It is correct that the second doesn't compile. To make the second compile, the overloaded operators for the complex type must be defined inside complex (which was/is? not possible). It should be possible now, I didn't test it though yet. The question i

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread michael . vancanneyt
On Fri, 22 Apr 2011, Florian Klämpfl wrote: mya.pp(16,12) Error: Operator is not overloaded: "complex" + "complex" myb.pp(9,14) Fatal: There were 1 errors compiling module, stopping Which is strange to say the least, as the per the definition/intent of generics, the code in mya should not kno

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Sven Barth
On 22.04.2011 11:23, Florian Klämpfl wrote: Am 22.04.2011 00:31, schrieb Michael Van Canneyt: On Thu, 21 Apr 2011, Sven Barth wrote: On 21.04.2011 21:45, Michael Van Canneyt wrote: On Thu, 21 Apr 2011, Marco van de Voort wrote: In our previous episode, Michael Van Canneyt said: You ca

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Sven Barth
On 22.04.2011 11:19, Florian Klämpfl wrote: Am 22.04.2011 11:18, schrieb Florian Klämpfl: Am 22.04.2011 00:08, schrieb Jonas Maebe: On 21 Apr 2011, at 23:26, Sven Barth wrote: On 21.04.2011 21:45, Michael Van Canneyt wrote: Threefold: a) The compiler's handling of generics is still beta cod

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 00:31, schrieb Michael Van Canneyt: > > > On Thu, 21 Apr 2011, Sven Barth wrote: > >> On 21.04.2011 21:45, Michael Van Canneyt wrote: >>> >>> >>> On Thu, 21 Apr 2011, Marco van de Voort wrote: >>> In our previous episode, Michael Van Canneyt said: > > You can propose w

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 11:18, schrieb Florian Klämpfl: > Am 22.04.2011 00:08, schrieb Jonas Maebe: >> >> On 21 Apr 2011, at 23:26, Sven Barth wrote: >> >>> On 21.04.2011 21:45, Michael Van Canneyt wrote: Threefold: a) The compiler's handling of generics is still beta code in my opinion. As far as

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Florian Klämpfl
Am 22.04.2011 00:08, schrieb Jonas Maebe: > > On 21 Apr 2011, at 23:26, Sven Barth wrote: > >> On 21.04.2011 21:45, Michael Van Canneyt wrote: >>> Threefold: a) The compiler's handling of generics is still beta >>> code in my opinion. As far as I know, the original problem I >>> reported when wri

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread michael . vancanneyt
On Fri, 22 Apr 2011, Marco van de Voort wrote: In our previous episode, Michael Van Canneyt said: However when implemented using generics you can also directly use the specialized type, and have fairly quick direct access. You don't need generics for that. Any form of an array of bytes wil

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Sven Barth
On 22.04.2011 00:31, Michael Van Canneyt wrote: But then different rules will apply for operators and procedure calls: - procedure calls must be resolvable at define time - Operators must be resolvable at specialization time. No principal problem (we can define it so), but strange at least. (BTW

Re: [fpc-pascal] FPImage and GetDataLineStart

2011-04-22 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: > > > > However when implemented using generics you can also directly use the > > specialized type, and have fairly quick direct access. > > You don't need generics for that. Any form of an array of bytes will do, > since that's what it amounts t