Re: [fpc-pascal] Inline methods

2016-05-18 Thread Sven Barth
Am 18.05.2016 10:06 schrieb "LacaK" : > > Hi *, > is it possible inline also methods of objects (not regular procedures) ? > I have very simple class method, which call I need inline. > (looking at assembler code it is not inlined; I have looked also in documentation, but I do not found article abo

Re: [fpc-pascal] passing "array of const" into cdecl procvar

2016-05-13 Thread Sven Barth
Am 13.05.2016 21:47 schrieb "Maciej Izak" : > > 2016-05-13 17:58 GMT+02:00 Seth Grover : >> >> How can I do this? Is there any way for me to pass an array of const argument through directly to a cdecl'ed procvar call? > > > Sven is wrong, of course you can, but it requires some work. Maybe not much

Re: [fpc-pascal] passing "array of const" into cdecl procvar

2016-05-13 Thread Sven Barth
Am 13.05.2016 17:58 schrieb "Seth Grover" : > How can I do this? Is there any way for me to pass an array of const argument through directly to a cdecl'ed procvar call? You can't, because an array of const/vararg of a cdecl function is something completely different from a normal Pascal array of c

Re: [fpc-pascal] Smart Pointers

2016-05-11 Thread Sven Barth
On 11.05.2016 22:23, Florian Klämpfl wrote: > Am 11.05.2016 um 14:12 schrieb Maciej Izak: >> 2016-05-11 13:46 GMT+02:00 Michael Van Canneyt > >: >> >> Anything the compiler needs *must* be in the system unit. The compiler >> should only assume the system unit,

Re: [fpc-pascal] code example where AnsiString used in FCL (SqlDB) causes data loss

2016-05-11 Thread Sven Barth
Am 11.05.2016 19:35 schrieb "Santiago A." : > Something about codpages needs a second thought. > > a) There shouldn't be automatic conversion at all. > b) The codepage of a string shouldn't change when you assign a string with another codepage, just rise an error. > c) Corollary of previous premise

Re: [fpc-pascal] Smart Pointers

2016-05-11 Thread Sven Barth
Am 11.05.2016 14:42 schrieb "Maciej Izak" : > > 2016-05-11 14:23 GMT+02:00 Michael Van Canneyt : >> >> Where is that written ? As far as I know, it is only there because classes >> is there, and classes has some define to allow it to be compiled with fgl. >> > > by Sven (29 January 2016 10:54 thre

Re: [fpc-pascal] Invoking methods through rtti

2016-05-11 Thread Sven Barth
Am 11.05.2016 10:22 schrieb "Michael Schnell" : > > On 05/09/2016 05:36 PM, Sven Barth wrote: >> >> >> As long as you know the signature of the method you can cast the pointer to the method to an approbiate method variable and call that. For dynamic calls you&#x

Re: [fpc-pascal] Smart Pointers

2016-05-10 Thread Sven Barth
Am 10.05.2016 21:18 schrieb "Florian Klämpfl" : > > Am 10.05.2016 um 10:07 schrieb Maciej Izak: > > 2016-05-09 22:11 GMT+02:00 Florian Klämpfl mailto:flor...@freepascal.org>>: > > > > Who said that? We discussed the syntax etc. and at least I see good changes to integrate it in trunk > > as

Re: [fpc-pascal] Smart Pointers

2016-05-10 Thread Sven Barth
Am 10.05.2016 23:06 schrieb "Maciej Izak" : >> >> That is with (note these functions are generic): >> >> procedure Foo1(A: TArray); >> procedure Foo2(var A: TArray); >> procedure Foo3(out A: TArray); >> >> Where each can be called with a TManagedArray as the "A" argument without qualifying the Inst

Re: [fpc-pascal] The world is ending

2016-05-09 Thread Sven Barth
Am 09.05.2016 23:38 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-05-09 20:34, Jonas Maebe wrote: > > While still missing in the documentation, you can already do that with > > {$modeswitch unicodestrings}. > > > Very good to know. Is that in FPC 3.0.x too, or only FPC T

Re: [fpc-pascal] Smart Pointers

2016-05-09 Thread Sven Barth
On 09.05.2016 22:11, Florian Klämpfl wrote: > Am 09.05.2016 um 21:40 schrieb Maciej Izak: >> 2016-05-09 19:50 GMT+02:00 Mazo Winst > >: >> >> I read that mails about implementation of management operators and smart >> pointers. >> >> 1 - These features are expe

Re: [fpc-pascal] Smart Pointers

2016-05-09 Thread Sven Barth
Am 09.05.2016 19:50 schrieb "Mazo Winst" : > > Hello list, > > I don't know if here is the correct place to make this question. > > I read that mails about implementation of management operators and smart pointers. > > 1 - These features are expected to be available in which version? They are curr

Re: [fpc-pascal] Invoking methods through rtti

2016-05-09 Thread Sven Barth
Am 09.05.2016 18:19 schrieb "Mazo Winst" : > > > > Em segunda-feira, 9 de maio de 2016, Sven Barth < pascaldra...@googlemail.com> escreveu: > > Am 09.05.2016 17:23 schrieb "Mazo Winst" : > >> > >> Is there any way to invoke a method pa

Re: [fpc-pascal] Invoking methods through rtti

2016-05-09 Thread Sven Barth
Am 09.05.2016 17:23 schrieb "Mazo Winst" : > > Is there any way to invoke a method passing parameters through rtti? As long as you know the signature of the method you can cast the pointer to the method to an approbiate method variable and call that. For dynamic calls you'll need to wait for Invok

Re: [fpc-pascal] Warning not to use the "String" type with FPC 3.x

2016-05-09 Thread Sven Barth
Am 09.05.2016 13:11 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-05-09 11:47, Jonas Maebe wrote: > > Having opinions available is not the issue. Getting people to completely > > implement all of their opinions so that we can compare all options in > > practice, > > And

Re: [fpc-pascal] TThread and WaitFor

2016-05-06 Thread Sven Barth
Am 06.05.2016 11:34 schrieb "LacaK" : > > Hi *, > is this safe: > > FThread.Terminate; // what if here is switched FThread to execution and will immediately end his Execute procedure > FThread.WaitFor; // what happens if FThread is freed before WaitFor is executed > > ? > > assuming, that FThread h

Re: [fpc-pascal] Property Attributes

2016-05-02 Thread Sven Barth
Am 02.05.2016 08:59 schrieb "Mazo Winst" : > > Hello, > > http://wiki.freepascal.org/Property_attributes. > > 1 - Is there any plans to merge the branch which contains the implementation of class attributes for the next release? The 3.0.x series won't contain this feature. My plan is however to me

Re: [fpc-pascal] UnicodeString and surrogate pairs

2016-04-29 Thread Sven Barth
Am 30.04.2016 08:24 schrieb "Michael Schnell" : > > On 04/29/2016 11:09 AM, Graeme Geldenhuys wrote: >> >> >> No, because UTF-8 doesn't use surrogate pairs. > > Really ? > > I understand that "surrogate pairs" is combining a printable character (i.e on of the nearly 2^32 UTF thingies) with another

Re: [fpc-pascal] FPC create unit path

2016-04-27 Thread Sven Barth
On 27.04.2016 21:57, Graeme Geldenhuys wrote: > On 2016-04-27 20:39, Darius Blaszyk wrote: >> Is there a way to have FPC to create the requested >> folder? > > I asked the same thing years back, and I was told that no, it's not the > job of the compiler, but rather the job of the build script or

Re: [fpc-pascal] Class/Record helpers on genericd?

2016-04-25 Thread Sven Barth
Am 25.04.2016 22:44 schrieb "Anthony Walter" : > > Sven, > > Correct me if I'm wrong, but didn't you add support for class/record helpers on generics? For example I'd like to be able to add methods to dynamic arrays: > > type > TArray = array of ; > TCompare = function(constref A, B: T): Intege

Re: [fpc-pascal] Build in a C compiler

2016-04-20 Thread Sven Barth
Am 20.04.2016 13:29 schrieb "Rainer Stratmann" : > > Am Mittwoch, 20. April 2016, 07:05:10 schrieb Mark Morgan Lloyd: > > No. Pascal and ALGOL are closely related, C and ALGOL are closely > > related. Pascal and C are not so closely related. > > As you can see here Pascal, C, and Basic are very clo

Re: [fpc-pascal] Any chance to add the TStringBuilder to FCL?

2016-04-18 Thread Sven Barth
Am 18.04.2016 07:58 schrieb "Jürgen Hestermann" : > And why was a directive implemented to use 0-based indices > even for strings but none for 1-based indices in dynamic arrays? > IMO the latter would be much more desired. The usual reason: Delphi compatibility. If Delphi wouldn't have that direct

Re: [fpc-pascal] Any chance to add the TStringBuilder to FCL?

2016-04-15 Thread Sven Barth
Am 15.04.2016 18:37 schrieb "Jürgen Hestermann" : > > Another advantage of having 1-based indeces in dyn. arrays > would be that you could store indeces in unsigned integers > while with 0-based indices high() may give -1. Indices in Pascal are always signed. Regards, Sven ___

Re: [fpc-pascal] Error: Internal error 2014052302 on changing some common units

2016-04-15 Thread Sven Barth
Am 15.04.2016 13:40 schrieb "Dennis" : > > whenever I change the source of a common unit (that is used by many other units), when I compile with lazarus 1.7 +FPC 3.1.1, this error will appear in the messages > "Error: Internal error 2014052302". Are you sure that you're using the most current vers

Re: [fpc-pascal] A better way?

2016-04-15 Thread Sven Barth
Am 15.04.2016 13:58 schrieb "Ryan Joseph" : > > > > On Apr 15, 2016, at 5:13 PM, Tony Whyman wrote: > > > > unit unitA; > > > > interface > > > > type > > > > class TClassA > > private > > FClassBObject: TObject; > > public > > procedure SomeProc; > > end; > > > > implementation > > > > uses uni

Re: [fpc-pascal] A better way?

2016-04-15 Thread Sven Barth
Am 15.04.2016 11:22 schrieb "Dennis" : > > >> > You could describe it as typecast done in the var clause of a method. The right hand identifier is not restricted to function parameters. >> >> While it works using "absolute" for a public API is rather unsafe (I'd only use that in private methods). I

Re: [fpc-pascal] Any chance to add the TStringBuilder to FCL?

2016-04-15 Thread Sven Barth
Am 15.04.2016 10:47 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > Is there also a switch > > {$OneBasedDynArrays On} ? > > No more confusion about first and last element index. > > You really should be using low() and high() instead. ;-) Definitely (and they also work for stri

Re: [fpc-pascal] A better way?

2016-04-15 Thread Sven Barth
Am 15.04.2016 08:46 schrieb "Ryan Joseph" : > Does this look like more work than using $includes? Maybe I need to seriously considering reorganizing my projects to work like this but it just feels wrong for some reason. > > = > > unit Globals; > interface > > type > HCla

Re: [fpc-pascal] A better way?

2016-04-15 Thread Sven Barth
Am 15.04.2016 10:46 schrieb "Tony Whyman" : > > Ryan, > > If you want to get rid of (ugly) typecasts then maybe you should investigate the "absolute" keyword. You get a lot of examples in the LCL. For example, here's one I chose at random: > > function TGtk2WidgetSet.RawImage_CreateBitmaps(const AR

Re: [fpc-pascal] Any chance to add the TStringBuilder to FCL?

2016-04-14 Thread Sven Barth
Am 14.04.2016 23:22 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-04-14 19:27, Sven Barth wrote: > > We already have zero based strings in 3.0.0 if {$ZeroBasedStrings On} is > > used (it's a local switch). > > Wow, learnt s

Re: [fpc-pascal] Any chance to add the TStringBuilder to FCL?

2016-04-14 Thread Sven Barth
On 14.04.2016 19:36, leledumbo wrote: >> Is there any chance to add a class like Delphi's TStringBuilder to FCL? It > would be very useful to port Delphi code libraries to Free Pascal. > > That exists mainly to overcome the read-only, 0-based string implementation > limitations in Delphi NextGen,

Re: [fpc-pascal] A better way?

2016-04-14 Thread Sven Barth
Am 14.04.2016 10:45 schrieb "Ryan Joseph" : > > > > On Apr 14, 2016, at 3:02 PM, Tony Whyman wrote: > > > > Reading through your post, I hope that you are aware that most circular dependencies can be avoided by referencing other units from the "uses" clause in the "implementation" section and keep

Re: [fpc-pascal] Initialization in Shared Libraries

2016-04-13 Thread Sven Barth
On 13.04.2016 21:30, Mazola Winstrol wrote: > 2016-04-13 15:56 GMT-03:00 Jonas Maebe >: > > > And hence you can just initialise those variables in the > initialization section of the library and finalize them (if > necessary) in the finalization sect

Re: [fpc-pascal] Implicit Operator Overloading

2016-04-10 Thread Sven Barth
Am 10.04.2016 22:15 schrieb "Mazola Winstrol" : > > 2016-03-07 3:53 GMT-03:00 Sven Barth : >> >> Am 06.03.2016 22:09 schrieb "Mazola Winstrol" : >> > >> > Hello, >> > >> > Fpc: 3.0 >> > >> > Should t

Re: [fpc-pascal] FPC generated executables and digital signatures

2016-04-08 Thread Sven Barth
Am 08.04.2016 13:20 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > Hi, > > I don't visit Windows much, but was doing some testing on a Win7 VM. > Every time I run my FPC generated executable I get a Security Warning > dialog pop up and it mentions a "Unknown Publisher", and I hav

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Sven Barth
Am 06.04.2016 16:28 schrieb "Dennis" : > > objects unit contains >TObject = OBJECT > CONSTRUCTOR Init; > PROCEDURE Free; > FUNCTION Is_Object(P:Pointer):Boolean; > DESTRUCTOR Done; Virtual; >END; > > > On the other hand, objpash.inc contains >TObject = class

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Sven Barth
Am 06.04.2016 13:23 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > Hi, > > I use Class and Object data types frequently in my code. I like the fact > that Object data types can be used without first instantiating an > instance and it gets freed automatically. Note: with the mode

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Sven Barth
Am 06.04.2016 14:06 schrieb "Tomas Hajny" : > > On Wed, April 6, 2016 13:26, Michael Van Canneyt wrote: > > On Wed, 6 Apr 2016, Graeme Geldenhuys wrote: > > Hi, > > >> I use Class and Object data types frequently in my code. I like the fact > >> that Object data types can be used without first inst

Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-04 Thread Sven Barth
Am 04.04.2016 13:21 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-04-04 12:06, Michael Van Canneyt wrote: > > 1. Using UTF8 is a choice of lazarus. Other people may prefer UnicodeString. > > On Windows, UnicodeString is more 'natural' or 'native'. > > Based on Intern

Re: [fpc-pascal] Class constructor called unconditionally

2016-03-31 Thread Sven Barth
Am 31.03.2016 17:28 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-03-31 16:06, Michael Van Canneyt wrote: > > > I am guessing it comes from C++/Java/C#, which AFAIK do not have > > the 'initialization' section. But that's just a guess. > > [my personal opinion - feel fre

Re: [fpc-pascal] Class constructor called unconditionally

2016-03-31 Thread Sven Barth
Am 31.03.2016 15:33 schrieb "silvioprog" : > After read this explanations, is there some compiler option to make FPC with this same Delphi behaviour? I'm using MODE DELPHI. No, there is not. Currently class constructors (and destructors) are called always. Regards, Sven __

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-30 Thread Sven Barth
Am 30.03.2016 10:37 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > At that time word size might vary dramatically from system to system ( > > https://en.wikipedia.org/wiki/Word_(computer_architecture) ) > > Interesting. I never knew Word was platform dependant. I see even for >

Re: [fpc-pascal] How to crosscompile i386-linux from X86_64-win64

2016-03-30 Thread Sven Barth
Am 30.03.2016 10:39 schrieb "ulrich" : > > Dne 29.3.2016 v 12:19 Sven Barth napsal(a): >> >> Am 29.03.2016 10:30 schrieb "Jonas Maebe" >> > <mailto:jonas.ma...@elis.ugent.be>>: >> >> > >> > On 29/03/16 09:58, ulric

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-29 Thread Sven Barth
Am 29.03.2016 17:27 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-03-29 16:13, Marco van de Voort wrote: > > Cardinal is the Wirthian designation for the default unsigned integer, > > just like "integer" is for signed. > > Thanks Marco, that fulfils my curiosity. :) > >

Re: [fpc-pascal] How to crosscompile i386-linux from X86_64-win64

2016-03-29 Thread Sven Barth
Am 29.03.2016 10:30 schrieb "Jonas Maebe" : > > On 29/03/16 09:58, ulrich wrote: >> >> what parameter(s) need to cross-compiling i386-Linux from X86_64-win64 ? > > > It is not possible, because the needed 80 bits extended type is not supported on Win64, and we don't have emulation for this type yet

Re: [fpc-pascal] Mangle name in fpc-FreeBSD ?

2016-03-21 Thread Sven Barth
Am 21.03.2016 13:57 schrieb "fredvs" : > > > Even on Win64 that would have been wrong as there TLibHandle is 64-bit as > well and it also defines MSWINDOWS. > > Hello Sven. > > I am unforgivable to not have seen that wrong declaration. > > And to not have deeply check code from other before to comm

Re: [fpc-pascal] Mangle name in fpc-FreeBSD ?

2016-03-20 Thread Sven Barth
Am 21.03.2016 00:33 schrieb "fredvs" : > > Aargh. > > Indeed, the declaration of variable for the library-handle was wrong. > And FreeBSD is more strait than Linux and Windows. Even on Win64 that would have been wrong as there TLibHandle is 64-bit as well and it also defines MSWINDOWS. Regard

Re: [fpc-pascal] Mangle name in fpc-FreeBSD ?

2016-03-19 Thread Sven Barth
Am 20.03.2016 00:57 schrieb "fredvs" : > PS: This is a great victory who will solve (I hope) other library-related > problems. > PS2: Are there limitations of using dlsym() vs GetProcedureAdress() ? > PS3: If dlsym() is cross-platform too, should I update all my codes that use > GetProcedureAdress(

Re: [fpc-pascal] Mangle name in fpc-FreeBSD ?

2016-03-14 Thread Sven Barth
Am 14.03.2016 16:16 schrieb "fredvs" : > > Hello. > > I have problem to access methods from a C library. > > For FreeBSD, the methods cannot be accessed (but ok for Linux and Windows). > > In FreeBSD, LoadLibrary(aac.so) is working but all GetProcAdress() for each > method fail. > > I already ask h

Re: [fpc-pascal] Fpc 3.0 Bug: type specialization and operator overload

2016-03-12 Thread Sven Barth
Am 12.03.2016 22:45 schrieb "Mazola Winstrol" : > > Hello, > > Fpc version: 3.0 (the one provided by Lazarus). > > Please confirm if this is a bug regarding operator overloading and type specialization. It is a quite difficult to explain, but i will try. > [snip] > > It seems the compiler treats th

Re: [fpc-pascal] Primitive Record Wrappers

2016-03-11 Thread Sven Barth
Am 11.03.2016 08:19 schrieb "Michael Van Canneyt" : > > > > On Fri, 11 Mar 2016, Sven Barth wrote: > >> Am 11.03.2016 04:16 schrieb "silvioprog" : >>> >>> >>> On Sun, Mar 6, 2016 at 7:21 PM, Mazola Winstrol >> >> wrot

Re: [fpc-pascal] Primitive Record Wrappers

2016-03-10 Thread Sven Barth
Am 11.03.2016 04:16 schrieb "silvioprog" : > > On Sun, Mar 6, 2016 at 7:21 PM, Mazola Winstrol wrote: > [...] >> >> Please see the code in attachments and send your suggestions / remarks. > > > Thanks for share. > > How do I use the the NullableTypes.String unit? > > Tried: > > program project1; >

Re: [fpc-pascal] CMem issue?

2016-03-07 Thread Sven Barth
Am 08.03.2016 01:51 schrieb "silvioprog" : > > Hello, > > I got an AV in the CMem unit. To reproduce the problem just compile and run this code below: > > === code === > > program project1; > > {$mode delphi} > > uses > Classes, SysUtils, cmem; > [Snip] > === /code === *Always* put an alternate

Re: [fpc-pascal] Implicit Operator Overloading

2016-03-06 Thread Sven Barth
Am 06.03.2016 22:09 schrieb "Mazola Winstrol" : > > Hello, > > Fpc: 3.0 > > Should the compiler to allow the definition of two operator overloading with the same parameters and diferent result types? > > e.g: > > code > > TMyRecord record > class operator Implicit(A: TMyRecord): Re

Re: [fpc-pascal] Fpc Bug: Type specialization with Generics and Operator Overloading in Diferent Units

2016-03-06 Thread Sven Barth
Am 06.03.2016 19:55 schrieb "Mazola Winstrol" : > > Hello, > > Fpc version: 3.0 (the same included with lazarus 1.6). > > > Please confirm if it is a bug: > > If i declare a generic record with overloaded add operation, i need to specialize the type in the same unit for the compiler recognize the o

Re: [fpc-pascal] Fpc Bug 3.0: Generics and Operator Overloading

2016-03-06 Thread Sven Barth
Am 06.03.2016 19:42 schrieb "Mazola Winstrol" : > > Hello, > > Fpc version: 3.0 (the one included with Lazarus 1.6). > > Please confirm if it is a bug: it seems the compiler doesn't handle operator overloading properly when using generic record with local specializations. Yes, that's a bug. Please

Re: [fpc-pascal] Bls: Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-03-06 Thread Sven Barth
Am 06.03.2016 17:00 schrieb "Serguei TARASSOV" : > >> So in my taste the {$MODE DELPHI} should have been support not only > >> language > >> features but all common libraries too, at least RTL/DB. All FPC > >> extension/modifications could be added in FPC mode. Not easy but > >> reliable. > > > > I

Re: [fpc-pascal] compile Link Smart option, is it -XX or -CX?

2016-03-03 Thread Sven Barth
Am 03.03.2016 09:26 schrieb "Dennis" : > > According to http://www.freepascal.org/docs-html/prog/progse30.html > > the smartlink option on the command line is -CX > but in Lazarus ver 1.42, >Compilation and Linking > Linking > Link Smart is -XX They are different. -CX tells the

Re: [fpc-pascal] Access violation in an empty project declaring heaptrc

2016-03-02 Thread Sven Barth
Am 03.03.2016 03:07 schrieb "silvioprog" : > Now, if you compile and run this project below with -gh: > > program project1; > > {$mode objfpc}{$H+} > > begin > end. > > You will get: > > Heap dump by heaptrc unit > 47 memory blocks allocated : 1173/1280 > 47 memory blocks freed : 1173/1280 > 0

Re: [fpc-pascal] Primitive Record Wrappers

2016-03-01 Thread Sven Barth
Am 01.03.2016 04:08 schrieb "Mazola Winstrol" : > Is there any way to overcome this? Is there any way to tell the compiler to ignore some operators depending on the specialization type? No, there is not. Better not use operators other than the assignment ones or provide different Nullable types fo

Re: [fpc-pascal] Primitive Record Wrappers

2016-02-29 Thread Sven Barth
Am 29.02.2016 16:13 schrieb "Mazola Winstrol" : > > I have noticed that, by using generics, we can't overload arithmetic operators. > > E.g.: > > ... > class operator Negative(A: TNullableType): T; > ... > > class operator TNullableType.Negative(A: TNullableType): T; > begin > Result := -1 * A;

Re: [fpc-pascal] Primitive Record Wrappers

2016-02-27 Thread Sven Barth
Am 27.02.2016 09:36 schrieb "Maciej Izak" : > > 2016-02-27 4:38 GMT+01:00 Mazola Winstrol : >> >> In the code bellow, the generic type TNullableTyple is implemented (and incomplete for now). >> > > It can be done more optimal with incoming operators Initialize and Finalize. I have working implement

Re: [fpc-pascal] Codepage + class helper raises "Error identifier idents no member ..."

2016-02-27 Thread Sven Barth
Am 26.02.2016 20:31 schrieb "silvioprog" : > > Hello, > > Consider the following code: > > === code === > > program project1; > > {$mode objfpc}{$H+} > //{$codepage utf8} > > uses Classes; > > type > TFoo = class helper for TStream > public > procedure Bar; > end; > > procedure TFoo.Bar

Re: [fpc-pascal] Include directive for current procedure/method/function name?

2016-02-25 Thread Sven Barth
Am 26.02.2016 01:35 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-02-26 00:15, Graeme Geldenhuys wrote: > > Anybody know if there is something like that in FPC? > > No worries, found it. Seems Thunderbird doesn't search as well as > Firefox. ;) > > > I was looking for {$

Re: [fpc-pascal] Building FPC for Windows X64

2016-02-25 Thread Sven Barth
Am 25.02.2016 12:19 schrieb "Justin Smyth" : > When I try to build lazarus it fails , yet it I build the i386-win32 copy it works fine – its not lazarus it’s the copy of fpc I have created as I get the same error on a older copy of lazarus ( 1.2.6 as an example) Since my crystal ball is broken wou

Re: [fpc-pascal] Bls: Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Sven Barth
Am 25.02.2016 02:00 schrieb "Mr Bee" : > Maybe FPC devs should give us the "rule" or policy about what kind of change that is acceptable and not acceptable. So when we think of something new we could look at the rule and if it's doesn't comply then we don't need to bother to propose. There is not

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Sven Barth
Am 24.02.2016 16:44 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > Bo Berglund wrote: >> >> On Tue, 23 Feb 2016 23:58:37 +0100, Sven Barth >> wrote: >>> >>> What would really help here would be the warning that

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Sven Barth
Am 24.02.2016 12:30 schrieb "Bo Berglund" : > > On Tue, 23 Feb 2016 23:58:37 +0100, Sven Barth > wrote: > > > >What would really help here would be the warning that Jonas mentioned... > >For the above you could just use a local variable and be done with it

Re: [fpc-pascal] Compiler Mode?

2016-02-24 Thread Sven Barth
Am 24.02.2016 13:10 schrieb "Maciej Izak" : > > 2016-02-24 12:48 GMT+01:00 Anthony Walter : >> >> On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong and should not be used other than for people or companies trying to convert Delphi code to Free Pascal. >> >> What's the official

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-23 Thread Sven Barth
Am 23.02.2016 23:28 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > Serguei TARASSOV wrote: > >> There is no perfect way so why the language extension is the safest >> (remember recent discussion about IfThen pseudo-function). > > > More relevant to your situation, I remember

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-23 Thread Sven Barth
On 23.02.2016 17:21, Serguei TARASSOV wrote: > Michael Van Canneyt wrote >> I hope you will send the same mail to embarcadero/Idera. >> When they added methods to TPoint, they broke have the VCL code ? >> >> To avoid this, we would need to freeze the code as soon as it is released. > > Compared w

Re: [fpc-pascal] Android porting ideas

2016-02-21 Thread Sven Barth
Am 21.02.2016 19:36 schrieb "Michalis Kamburelis" : > > > > 1) All the file I/O in the FPC RTL is not available so what possible work arounds are there for loading data from files? > > Actually, all the IO in FPC works perfectly. You can read / write > files just like on any other Unix (although yo

Re: [fpc-pascal] Primitive Record Wrappers

2016-02-21 Thread Sven Barth
Am 21.02.2016 03:02 schrieb "Mazola Winstrol" : > > 2016-02-20 3:24 GMT-02:00 Michalis Kamburelis : >> >> The major problem there is that it's difficult to force it to be >> always initialized with zeroes. Currently, a non-global variable of >> unmanaged type can always be filled with memory garbag

Re: [fpc-pascal] [PATCH] Addition of OnNotify event on "TFPGObjectList" and "TFPGList" triggered on the insert, delete and extract methods.

2016-02-20 Thread Sven Barth
Am 20.02.2016 11:33 schrieb "denisgolovan" : > > Hi > > That always keeps me wondering - why neither FPC, no any other mainstream static-type language implements specialization based not only on types, but on compile-time constants as well? > Then you don't consider C++ as mainstream, do you? > I

Re: [fpc-pascal] [PATCH] Addition of OnNotify event on "TFPGObjectList" and "TFPGList" triggered on the insert, delete and extract methods.

2016-02-20 Thread Sven Barth
Am 20.02.2016 08:55 schrieb "Maciej Izak" : > > Notifications events already works in Generics.Collections. ;P > Which reminds me that I wanted to work on integrating them... Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

Re: [fpc-pascal] Primitive Record Wrappers

2016-02-20 Thread Sven Barth
Am 20.02.2016 06:25 schrieb "Michalis Kamburelis" : > I remember a thread on fpc-devel "Pascal Smart Pointers Idea + ARC > implementation" where the original author (Maciej Izak) was already > working to overcome this: > https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg33172.html > .

Re: [fpc-pascal] [PATCH] Addition of OnNotify event on "TFPGObjectList" and "TFPGList" triggered on the insert, delete and extract methods.

2016-02-19 Thread Sven Barth
Am 19.02.2016 20:47 schrieb "silvioprog" : > > On Fri, Feb 19, 2016 at 4:20 PM, Sven Barth wrote: > [...] > >> It doesn't matter whether it is requested over here or on Mantis. I'm against adding notifications to the generic lists, because that will degra

Re: [fpc-pascal] [PATCH] Addition of OnNotify event on "TFPGObjectList" and "TFPGList" triggered on the insert, delete and extract methods.

2016-02-19 Thread Sven Barth
Am 19.02.2016 14:45 schrieb "silvioprog" : > > On Fri, Feb 19, 2016 at 10:24 AM, Sven Barth wrote: >> >> Am 19.02.2016 12:45 schrieb "silvioprog" : >> > >> > Hello, >> > >> > I have a friend here in Brazil that added the `n

Re: [fpc-pascal] [PATCH] Addition of OnNotify event on "TFPGObjectList" and "TFPGList" triggered on the insert, delete and extract methods.

2016-02-19 Thread Sven Barth
Am 19.02.2016 12:45 schrieb "silvioprog" : > > Hello, > > I have a friend here in Brazil that added the `notify` support to the FGL lists, however he sented it to this Github PR [1]. I'm against that. That would negatively impact the performance of these lists. Regards, Sven _

Re: [fpc-pascal] Please someone explain this to me

2016-02-11 Thread Sven Barth
Am 11.02.2016 11:41 schrieb "Anthony Walter" : > > > This won't be changed. Period. > > Sven, not to be argumentative, but you do get that for a long time programmers have learned how to write code and use libraries by examining them? My goal is simply to make it easier for the people who would wan

Re: [fpc-pascal] Please someone explain this to me

2016-02-11 Thread Sven Barth
Am 11.02.2016 00:23 schrieb "Anthony Walter" : > > For those who didn't understand what I meant by using regions in the interface section rather than include files, here is an image of what is essentially in SysUtils currently: > > http://cache.getlazarus.org/images/sysutils-include.gif > > Notice

Re: [fpc-pascal] Please someone explain this to me

2016-02-10 Thread Sven Barth
Am 10.02.2016 21:03 schrieb "Anthony Walter" : > But to ask again, what's the purpose of using include files for the interface section of units when most everything in the interface sections remain unchanged among different platforms? Surely we can move all those the parts back to the unit interfac

Re: [fpc-pascal] Please someone explain this to me

2016-02-10 Thread Sven Barth
Am 10.02.2016 15:55 schrieb "Juha Manninen" : > > On Wed, Feb 10, 2016 at 4:09 PM, Sven Barth wrote: > > What about include files included by other include files? > > Ok, that is a nasty situation. I think it should be avoided. Welcome t

Re: [fpc-pascal] Please someone explain this to me

2016-02-10 Thread Sven Barth
Am 10.02.2016 14:09 schrieb "Juha Manninen" : > > On Wed, Feb 10, 2016 at 2:01 AM, Vojtěch Čihák wrote: > > There exists IDE directive > > > > {%MainUnit ***.pas} > > > > and include files should contain it. > > Yes, that is the solution for Anthony's problem. Most include files > used by LCL unit

Re: [fpc-pascal] Please someone explain this to me

2016-02-10 Thread Sven Barth
Am 10.02.2016 11:11 schrieb "Anthony Walter" : > > Marc, > > Your suggestions only work if a unit declaring the function is in your uses clauses. In the scenario I described that is clearly not the case. > > Additionally, and in a different scenario, when the identifier IS defined and several units

Re: [fpc-pascal] Please someone explain this to me

2016-02-09 Thread Sven Barth
Am 10.02.2016 00:32 schrieb "Ralf Quint" : > > On 2/9/2016 2:58 PM, Anthony Walter wrote: >> >> I really don't like the include files with Lazarus and Free Pascal for the following reason: >> >> How the am I supposed to know which file is including an include file? >> >> Often times I am tryin

Re: [fpc-pascal] IfThen() intrinsic removed

2016-02-05 Thread Sven Barth
Am 05.02.2016 10:46 schrieb "Lukasz Sokol" : > > On 05/02/16 09:22, Lukasz Sokol wrote: > > Hi, > > > > On 04/02/16 21:33, Michael Van Canneyt wrote: > >> > >> > >> On Thu, 4 Feb 2016, Felipe Monteiro de Carvalho wrote: > >> > >>> Disappointed :( > >> > >> Well, such is life. I'm also disappointed

Re: [fpc-pascal] Ararat Synapse UDP Rx Speed (Mbps)

2016-02-05 Thread Sven Barth
Am 05.02.2016 09:42 schrieb "Jonas Maebe" : > > > > On 04 Feb 2016, at 23:36, Brian wrote: > > > > A test with two Linux (Ubuntu 14.04) PC's each with a 1Gbps NIC , with one PC > > sending 300byte packets directly to the other PC (no switch involved) . > > I think you're posting to a different mai

Re: [fpc-pascal] IfThen() intrinsic removed

2016-02-04 Thread Sven Barth
Am 04.02.2016 23:43 schrieb "Martin" : > > On 04/02/2016 22:13, Michael Van Canneyt wrote: >> >> >> On Thu, 4 Feb 2016, Felipe Monteiro de Carvalho wrote: >>> >>> >>> You mean like literally using "?" and ":" ? >> >> >> Yes. As used in C-like languages. > > > There was also voices for a more verbos

[fpc-pascal] IfThen() intrinsic removed

2016-02-04 Thread Sven Barth
Hello together! The IfThen() intrinsic has been removed again. There will be *no* replacement in the foreseeable future. This is not up for discussion. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org

Re: [fpc-pascal] if-then-else expression

2016-02-03 Thread Sven Barth
Am 03.02.2016 12:11 schrieb "Serguei TARASSOV" : > > On 03/02/2016 12:00, fpc-pascal-requ...@lists.freepascal.org wrote: >> >> Date: Tue, 2 Feb 2016 19:43:02 -0700 (MST) >> From: silvioprog >> >> >>> >The problem with Iff() is:1) it either retains normal function behavior >>> >and thus has to evalu

Re: [fpc-pascal] if-then-else expression

2016-02-02 Thread Sven Barth
Am 02.02.2016 22:51 schrieb "geneb" : > > On Tue, 2 Feb 2016, Dmitry Boyarintsev wrote: > >> On Tue, Feb 2, 2016 at 4:40 PM, geneb wrote: >> >>> So it's not solving a /problem/ it's lessening an inconvienence(sp!). >>> >>> I would've gone with IIf(). :) >>> >> >> Just keep in mind that the thread

Re: [fpc-pascal] if-then-else expression

2016-02-02 Thread Sven Barth
On 02.02.2016 20:22, John Lee wrote: > So (Sven) to clarify, assume that your original ifthen [patch is now in > latest svn compiler although more work will needed to do x:=if a then b > else c;? j The IfThen() is in trunk though it will at least be renamed. The if-then-else expression would in t

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-02 Thread Sven Barth
Am 02.02.2016 15:39 schrieb "Serguei TARASSOV" : > > On 02/02/2016 15:16, fpc-pascal-requ...@lists.freepascal.org wrote: >> >> Date: Tue, 2 Feb 2016 14:36:25 +0100 >> From: Sven Barth >> >> >>> > >>> >You confuse left-to-right o

Re: [fpc-pascal] if-then-else expression

2016-02-02 Thread Sven Barth
On 02.02.2016 10:25, Michael Schnell wrote: > On 02/01/2016 09:35 PM, Maciej Izak wrote: >> >> >> x := if true then 0 else 1 > > Here a keyword and a statement just optionally returns a value, Same is > ignored in all legacy code but can be use it you want to and do know > what you do. > > Additi

Re: [fpc-pascal] Error compiling FPC trunk under Linux

2016-02-02 Thread Sven Barth
On 02.02.2016 19:12, Fabio Luis Girardi wrote: > > > 2016-02-02 16:07 GMT-02:00 Jonas Maebe >: > > > What is the version of your starting compiler? > > > 3.1.1 revision 32800. I don't remember the revision the compiler that > built this last one, but it'

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-02 Thread Sven Barth
Am 02.02.2016 16:11 schrieb "Martin" : > > On 02/02/2016 13:24, Sven Barth wrote: >> >> >> > Look at the "iif" as an statement and the things will be simple. >> >> BECAUSE. IT. IS. *NOT*. A. STATEMENT! >> It never was and it

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-02 Thread Sven Barth
Am 02.02.2016 13:56 schrieb "Serguei TARASSOV" : > > On 02/02/2016 13:41, fpc-pascal-requ...@lists.freepascal.org wrote: >> >> Date: Tue, 02 Feb 2016 13:22:01 +0100 >> From: Jonas Maebe >> >> Michael Van Canneyt wrote on Tue, 02 Feb 2016: >> >> [evaluating all arguments to a function/intrinsic] >>

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-02 Thread Sven Barth
Am 02.02.2016 13:51 schrieb "Serguei TARASSOV" : > > On 02/02/2016 13:41, fpc-pascal-requ...@lists.freepascal.org wrote: >> >> Date: Tue, 02 Feb 2016 10:32:28 -0200 >> From: Andreas Berger >> >> >> On Tue 02/02/2016 09:27, Jonas Maebe wrote: >>> >>> > >>> >The parameter evaluation order issue is ir

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-02 Thread Sven Barth
Am 02.02.2016 13:38 schrieb "Andreas Berger" : > > > On Tue 02/02/2016 09:27, Jonas Maebe wrote: >> >> >> The parameter evaluation order issue is irrelevant in this context: Delphi guarantees left-to-right (or used to anyway, this may have changed), FPC doesn't guarantee anything. >> > Wow, what's

<    9   10   11   12   13   14   15   16   17   18   >