Re: [fpc-pascal] TypeInfo question

2017-03-24 Thread Sven Barth via fpc-pascal
Am 24.03.2017 03:51 schrieb "Ryan Joseph" : > Is there anyway I could push the type checking to runtime? I wanted to using writeln also to perform some printing for debugging but I get stuck at compile time again trying to mix, integers, strings, records, classes etc…

Re: [fpc-pascal] Delphi for Linux is out

2017-03-23 Thread Sven Barth via fpc-pascal
On 23.03.2017 18:35, Florian Klämpfl wrote: > Am 23.03.2017 um 16:47 schrieb Mattias Gaertner: >> On Thu, 23 Mar 2017 16:08:20 +0100 (CET) >> Michael Van Canneyt wrote: >> >>> [...] When did FPC start to run on Linux? 1999? >>> >>> I got the first "hello world"

Re: [fpc-pascal] Delphi RTTI vs Free Pascal RTTI

2017-03-25 Thread Sven Barth via fpc-pascal
Am 24.03.2017 19:55 schrieb "Michael Van Canneyt" : > > > > On Fri, 24 Mar 2017, African Wild Dog wrote: > >> Hello, >> >> I need to write a code compatilble with both free pascal and delphi using >> the old style RTTI. >> What are the diferences between delphi's and free

Re: [fpc-pascal] TypeInfo question

2017-03-23 Thread Sven Barth via fpc-pascal
Am 23.03.2017 16:29 schrieb "Ryan Joseph" : > > I have some generics which operate on multiple types and instead of making subclasses for certain types and overriding methods I wonder if using the RTTI like: > > PTypeInfo(TypeInfo(T))^.kind = tkClass > > would be a good

Re: [fpc-pascal] Delphi for Linux is out

2017-03-23 Thread Sven Barth via fpc-pascal
Am 23.03.2017 13:05 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > Hi, > > Just thought I would mention, yesterday Delphi 10.2 was released which > includes Linux support (I assume a cross-compiler). It is only available > in the Enterprise edition product line though, and only

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 18.03.2017 23:27 schrieb "African Wild Dog" <paintedlyc...@gmail.com>: > > 2017-03-18 18:40 GMT-03:00 Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org>: >> >> Forward declarations for generic types are not supported. > > Are

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 00:02 schrieb "Bart" <bartjun...@gmail.com>: > > On 3/18/17, Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote: > > > Forward declarations for generic types are not supported. > > But it should not give an internal error.

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 05:07 schrieb "African Wild Dog" : > > Hello, > > Test env: debian jessie amd64 - fpc 3.0.2 > > It seems free pascal have a bug when handling interface inheritance using generics. > > When i try to compile the unit bellow, i get this error: > >

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 11:30 schrieb "Bart" <bartjun...@gmail.com>: > > On 3/19/17, Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote: > > >> But it should not give an internal error. > > > > With that I agree. Would you please check wi

Re: [fpc-pascal] rtl-generics vs fgl

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 10:10 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > Hi, > > Sorry if this is a silly question, I didn't really follow Generics > discussions in the past. If the "rtl-generics" package a replacement for > the fgl unit? The fgl unit is more lightweight while

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 17:55 schrieb "African Wild Dog" <paintedlyc...@gmail.com>: > > 2017-03-19 5:25 GMT-03:00 Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org>: >> >> I think this will happen with non-generic interfaces as well. So please test wi

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-18 Thread Sven Barth via fpc-pascal
Am 18.03.2017 19:20 schrieb "African Wild Dog" : > > Hello, > > Please confirm if this is a bug. > > When I try to compile the unit below I get the error: > > "generics_bug.pas(14,43) Fatal: Internal error 2012101001" > > It seems the compiler has bug when handling forward

Re: [fpc-pascal] Generics Bug

2017-03-18 Thread Sven Barth via fpc-pascal
Am 18.03.2017 19:55 schrieb "African Wild Dog" : > > Hello, > > > Please confirm this bug. > > The unit code bellow won't compile (fpc 3.0.2 - debian jessie amd64): > > "generics_bug.pas(17,48) Fatal: Syntax error, "," expected but "<" found" > > === CODE === > > unit

Re: [fpc-pascal] Generics Bug

2017-03-18 Thread Sven Barth via fpc-pascal
Am 18.03.2017 22:41 schrieb "Sven Barth" : > > Am 18.03.2017 19:55 schrieb "African Wild Dog" : > > > > Hello, > > > > > > Please confirm this bug. > > > > The unit code bellow won't compile (fpc 3.0.2 - debian jessie amd64): > > > >

Re: [fpc-pascal] Setting record values

2017-04-04 Thread Sven Barth via fpc-pascal
Am 04.04.2017 05:25 schrieb "Ryan Joseph" : > > Thanks for the tips, I appreciate it. > > This is all pretty trivial but it’s kind of annoying that using an inline class function is more efficient than a constructor despite having identical functionality. It's tempting

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Sven Barth via fpc-pascal
Am 04.04.2017 06:55 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > On Apr 2, 2017, at 11:02 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > can be easily seen by looking at the implementation of

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Sven Barth via fpc-pascal
Am 04.04.2017 12:52 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > On 02/04/17 10:00, Jonas Maebe wrote: > >> Allocating new memory via setlength also clears the memory (+ the >> overhead of allocating the memory). > > > Jonas, is it still the case that if SetLength()

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Sven Barth via fpc-pascal
Am 04.04.2017 13:55 schrieb "Ryan Joseph" : > > > > On Apr 4, 2017, at 4:58 PM, Howard Page-Clark via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > You can always use FillChar and its kin on specific 'nested' arrays like this > > > > type > > TIntArray =

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Sven Barth via fpc-pascal
On 04.04.2017 15:40, Ryan Joseph wrote: > >> On Apr 4, 2017, at 7:17 PM, Sven Barth via fpc-pascal >> <fpc-pascal@lists.freepascal.org> wrote: >> >> If you want continuous memory areas you need to use static arrays or develop >> your own dynamic da

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Sven Barth via fpc-pascal
On 04.04.2017 15:40, Ryan Joseph wrote: > >> On Apr 4, 2017, at 7:17 PM, Sven Barth via fpc-pascal >> <fpc-pascal@lists.freepascal.org> wrote: >> >> If you want continuous memory areas you need to use static arrays or develop >> your own dynamic da

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Sven Barth via fpc-pascal
On 04.04.2017 16:54, Ryan Joseph wrote: > >> On Apr 4, 2017, at 9:46 PM, Sven Barth via fpc-pascal >> <fpc-pascal@lists.freepascal.org> wrote: >> >> SetLength() allocates a single block of memory, cause array access is >> ordinary pointer arithmetic

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Sven Barth via fpc-pascal
On 04.04.2017 16:27, Ryan Joseph wrote: >>> Does SetLength on a single level dynamic array not even allocate a >>> continuous block of memory? >> >> Yes, it does (as explained in all the other mails). >> A (dynamic) array of integer will be allocated as a single block by >> SetLength. >> So if

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Sven Barth via fpc-pascal
On 04.04.2017 16:27, Ryan Joseph wrote: >>> Does SetLength on a single level dynamic array not even allocate a >>> continuous block of memory? >> >> Yes, it does (as explained in all the other mails). >> A (dynamic) array of integer will be allocated as a single block by >> SetLength. >> So if

Re: [fpc-pascal] Questions About Constructors

2017-03-31 Thread Sven Barth via fpc-pascal
Am 31.03.2017 19:27 schrieb "African Wild Dog" : > > 2017-03-30 4:25 GMT-03:00 Michael Van Canneyt : >> >> >> >> On Thu, 30 Mar 2017, African Wild Dog wrote: >> >>> Hello, >>> >>> 1 - What happens if my constructor raise an exception? Is my

Re: [fpc-pascal] Setting record values

2017-04-02 Thread Sven Barth via fpc-pascal
On 01.04.2017 09:59, Ryan Joseph wrote: > >> On Apr 1, 2017, at 2:46 PM, Sven Barth via fpc-pascal >> <fpc-pascal@lists.freepascal.org> wrote: >> >> I haven't looked at it in detail, but it could be that both have similar >> efficiency. You could also

Re: [fpc-pascal] Array clearing

2017-04-02 Thread Sven Barth via fpc-pascal
On 02.04.2017 11:22, Ryan Joseph wrote: > >> On Apr 1, 2017, at 9:25 PM, Jürgen Hestermann >> wrote: >> >> If you just need to reuse the same array and only need to zero its elements >> then of course fillchar would be the fastest approach (it saves the memory >>

Re: [fpc-pascal] Array clearing

2017-04-01 Thread Sven Barth via fpc-pascal
Am 01.04.2017 05:42 schrieb "Ryan Joseph" : > > As far as the compiler is concerned what’s the difference between clearing an array using a for-loop vs. FillChar? It seems like iterating the array would be slower but what does FillChar do exactly and is it faster? The

Re: [fpc-pascal] Setting record values

2017-04-01 Thread Sven Barth via fpc-pascal
Am 01.04.2017 05:59 schrieb "Ryan Joseph" : > > I’ve been using a design pattern in my code which I think is probably pretty stupid so I’d like to make sure. Assume I have a type like TPoint below and I want to set the value I’ll doing something like point :=

Re: [fpc-pascal] Array clearing

2017-04-01 Thread Sven Barth via fpc-pascal
Am 01.04.2017 10:35 schrieb "Ryan Joseph" : > > > > On Apr 1, 2017, at 2:50 PM, Ryan Joseph wrote: > > > > Yeah, I was concerned with just compiler types or weakly retained classes where I’m just keeping the reference. > > Another question.

Re: [fpc-pascal] Array clearing

2017-04-01 Thread Sven Barth via fpc-pascal
Am 01.04.2017 13:31 schrieb "Jürgen Hestermann" : > > I am wondering what the purpose of filling all > array elements with zero's could be. > If I want to discard all elements I would simply delete > the whole array (setlength(MyArray,0) ). > > But when should it be

Re: [fpc-pascal] Constants in generics

2017-04-12 Thread Sven Barth via fpc-pascal
Am 12.04.2017 17:06 schrieb : > > On 2017-04-09 06:32, Ryan Joseph wrote: >>> >>> On Apr 9, 2017, at 6:13 PM, Maciej Izak wrote: >>> >>> sure, but not directly. Try this: >> >> >> Thanks, that’s a seriously funky hack but it works. :) The only >> downside is

Re: [fpc-pascal] WebAssembly Target

2017-04-12 Thread Sven Barth via fpc-pascal
Am 12.04.2017 16:10 schrieb : > Why run webgl through javascript if you could just make something like a flash plugin object (like youtube videos) that plays opengl scenes using some native format similar to how flash uses SWF files, or whatever? Because the point is not to need

Re: [fpc-pascal] sqldb create/free lifetime of object

2017-04-12 Thread Sven Barth via fpc-pascal
Am 12.04.2017 14:32 schrieb : > In a way, this is a form of garbage collection or RAII sort of. And reduces the obnoxious free's required in non garbage collected programming languages... So it's a nice feature/trick to have ownership. But at the same time you can think there is

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Sven Barth via fpc-pascal
Am 12.04.2017 16:51 schrieb "Ryan Joseph" : > > > > On Apr 12, 2017, at 9:25 PM, Michael Van Canneyt wrote: > > > > Adding a pop/push requires compiler magic, and could be implemented; but the question is whether it is worth it, given the

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Sven Barth via fpc-pascal
Am 06.04.2017 11:58 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > On Apr 6, 2017, at 4:26 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > It's a difficult topic, cause in Object Pascal class instances

Re: [fpc-pascal] Get value of PPChar ?

2017-04-17 Thread Sven Barth via fpc-pascal
Am 17.04.2017 00:47 schrieb "fredvs" : > > Free Pascal - General mailing list wrote > > According to the code it also returns 0 with icy_meta being Nil if there > > is no corresponding data: > > https://github.com/georgi/mpg123/blob/master/src/libmpg123/libmpg123.c#L1384 > > Ha,

Re: [fpc-pascal] Get value of PPChar ?

2017-04-16 Thread Sven Barth via fpc-pascal
On 16.04.2017 18:52, fredvs wrote: > Free Pascal - General mailing list wrote >> function mpg123_icy(mh: Tmpg123_handle; var icy_meta: PChar): Integer; >> cdecl; > > Thanks for your answer. > > I did try with this but : > > res := mpg123_icy(mph,theicytag); > > if (res = 0) then

Re: [fpc-pascal] Array clearing

2017-04-13 Thread Sven Barth via fpc-pascal
Am 13.04.2017 13:25 schrieb "MARCOU Gilles" : > > Regarding this code: > >> SetLength(Array,Length(Array)+1); >> Array[High(Array)] := … > > > as I understood from (http://wiki.freepascal.org/Dynamic_array), SetLength will create a copy of the array and free the memory of the

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-14 Thread Sven Barth via fpc-pascal
Am 14.04.2017 09:23 schrieb "Michael Schnell" : > > On 12.04.2017 14:09, Lars wrote: >> >> If unix could just make processes even lighter weight or >> faster loading, I might avoid threads and just use processes... > > in Unix/Linux processes are not less "light" then threads.

Re: [fpc-pascal] Array clearing

2017-04-13 Thread Sven Barth via fpc-pascal
Am 13.04.2017 14:47 schrieb "Ryan Joseph" : > > > > On Apr 13, 2017, at 7:08 PM, Mattias Gaertner wrote: > > > >> as I understood from (http://wiki.freepascal.org/Dynamic_array< http://wiki.freepascal.org/Dynamic_array>), SetLength will

Re: [fpc-pascal] Array clearing

2017-04-13 Thread Sven Barth via fpc-pascal
Am 13.04.2017 18:06 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > On Apr 13, 2017, at 10:29 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > SetLength *does* use a reallocate for this, but since it doesn't

Re: [fpc-pascal] Can class function used in specialized class use intristic functions Low, High with generic type ?

2017-04-20 Thread Sven Barth via fpc-pascal
Am 20.04.2017 13:02 schrieb "LacaK" : > > Hi *, > > I have some generic class: > > generic T2DNumericArray = object(specialize T2DArray) > public > class function Truncate(Value: double): T; inline; > ... > > In class function Truncate I want check if supplied

Re: [fpc-pascal] Use a procedural type for declare a procedure\function

2017-04-20 Thread Sven Barth via fpc-pascal
Am 20.04.2017 08:44 schrieb "Andrey M, Zubarev" : > > Hi All, > > Why can't use procedural type for declare a procedure\function? > Why ever allow the exact same signature? It's uncomfortable > Maybe it makes sense to introduce into the language such a possibility? No, that

Re: [fpc-pascal] Get value of PPChar ?

2017-04-16 Thread Sven Barth via fpc-pascal
On 16.04.2017 16:58, fredvs wrote: > Hello. > > A C method is defined like this: > > MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); > > and translated in Pascal with this: > > function mpg123_icy(mh: Tmpg123_handle; var icy_meta: PPChar): integer; > cdecl; This is wrong.

Re: [fpc-pascal] Can class function used in specialized class use intristic functions Low, High with generic type ?

2017-04-22 Thread Sven Barth via fpc-pascal
Am 22.04.2017 08:18 schrieb "Cyrax" : > I think that this was the bug report and which you did fix back then : Indeed it is :) Regards, Sven ___ fpc-pascal maillist -

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-04 Thread Sven Barth via fpc-pascal
Am 04.03.2017 16:06 schrieb "fredvs" : > > Hello. > > Is it possible to add a array of float into ressource ? > > For example, there is myarray : array of cfloat. > > Is it possible to store that array myarray ressource and, when I want to use > it from ressource, I get also a

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-06 Thread Sven Barth via fpc-pascal
Am 06.03.2017 13:42 schrieb "fredvs" : > > > I don't know. By all logic, it should not work either. > > Yes, it is I think too. > > Some more explanation: > > I use a "global" buffer of float to store data. > Those data can be int16, int32 or float32. > > For example, > > If

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-06 Thread Sven Barth via fpc-pascal
On 06.03.2017 19:31, fredvs wrote: >> Or, quite comically maybe: use a text file > > Or maybe, like in my second post, convert float32 ---> integer32 > > for x := 0 to length(floatbuffer) -1 do > begin >floatbuffer[x] := round(floatbuffer[x] * 2147483647); >if floatbuffer[x] >

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-06 Thread Sven Barth via fpc-pascal
Am 06.03.2017 22:45 schrieb "fredvs" : > > > I don't know what you're doing wrong, but the following works: > > Huh, it is exactly what I (think to) do. > And re-reading hundred times my code does not see any difference. > > OK, I will re-read thousand times the code, maybe I

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-07 Thread Sven Barth via fpc-pascal
Am 06.03.2017 23:57 schrieb "fredvs" : > > Re-hello. > > Ok, I do not find yet the guilty in my code, I will re-try a other day. > By the way, your code is working perfectly Sven. > > Now, last part of the question: how to convert that file stored into > ressource but without to

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-07 Thread Sven Barth via fpc-pascal
Am 07.03.2017 13:49 schrieb "fredvs" : > > > To access a file stored as a resource you need to use TResourceStream. > > Ho my Dog, I did not know this one. > More than perfect, many thanks Sven. > > PS: About array of float into TFileStream, after Googling a while, it s not >

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-05 Thread Sven Barth via fpc-pascal
Am 05.03.2017 18:33 schrieb "fredvs" : > > Hello. > > I have saved the buffer into file with a TFileStream. > > With lot of success for array of cint16 and cint32. > > But for array of cfloat --> much less success. Define "much less success". How are you writing the array and

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-07 Thread Sven Barth via fpc-pascal
On 07.03.2017 22:39, fredvs wrote: > OK, Sven you win (and http://stackoverflow.com should follow fpc forum). > But you will not convince me that c does better than fpc, maybe equal but > surely not better. Despite me definitely favoring Object Pascal as well, I can't you have spreading

Re: [fpc-pascal] Adding a array of float in ressource and use it ?

2017-03-07 Thread Sven Barth via fpc-pascal
On 07.03.2017 16:30, fredvs wrote: >>> Many thanks Sven for your help. >>> Do you agree if I add your name into the list of the "great contributors" >>> of >>> uos (https://github.com/fredvs/uos) ? >> I don't think that's necessary. I'm merely doing my "job"... > > OK, I understand. (But I ask it

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Sven Barth via fpc-pascal
Am 06.04.2017 10:32 schrieb "Ryan Joseph" : > > Does it exist now or has it ever been discussed that a method in TObject could be called when an instance of an object goes out of scope? It’s common to clean up objects in a function body after the function exits and

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Sven Barth via fpc-pascal
Am 19.04.2017 06:35 schrieb "Ryan Joseph" : > > > > On Apr 19, 2017, at 2:34 AM, Daniel Gaspary wrote: > > > > Using SetJmp and LongJmp? > > > > I believe some months ago it was a discussion on the list on why this > > was not really the way to

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Sven Barth via fpc-pascal
Am 19.04.2017 11:26 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > On Apr 19, 2017, at 4:14 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > Those functions simply store (setjmp) and restore (longjmp) regi

Re: [fpc-pascal] XML: Differences between Delphi and FPC

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 09:30 schrieb "Sven Barth" : > > Am 30.07.2017 02:01 schrieb "Marcos Douglas B. Santos" : > > > > Hi, > > > > FPC/Lazarus always tried stay compatible with Delphi... thus, why the > > FPC XML classes is so different than Delphi classes?

Re: [fpc-pascal] XML: Differences between Delphi and FPC

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 02:01 schrieb "Marcos Douglas B. Santos" : > > Hi, > > FPC/Lazarus always tried stay compatible with Delphi... thus, why the > FPC XML classes is so different than Delphi classes? > > Delphi XML is interface-based. There exists IXMLDocument, IXMLNode and so on. >

Re: [fpc-pascal] TInifile does not handle " " (space) as a value.

2017-08-15 Thread Sven Barth via fpc-pascal
Am 15.08.2017 11:57 schrieb "Michael Van Canneyt" <mich...@freepascal.org>: > > > > On Tue, 15 Aug 2017, Sven Barth via fpc-pascal wrote: > >> Am 15.08.2017 11:17 schrieb "Michael Van Canneyt" <mich...@freepascal.org >: >>>

Re: [fpc-pascal] Defining sonames?

2017-08-13 Thread Sven Barth via fpc-pascal
Am 13.08.2017 17:42 schrieb "Fred van Stappen" : > > Hello Martin. > > Description of libx11-dev package (in /DEBIAN/control). > > Package: libx11-dev > ... > Description: > > This package contains the development headers for the library found in libx11-6. > Non-developers

Re: [fpc-pascal] TInifile does not handle " " (space) as a value.

2017-08-15 Thread Sven Barth via fpc-pascal
Am 15.08.2017 11:17 schrieb "Michael Van Canneyt" : > > > > On Mon, 14 Aug 2017, Graeme Geldenhuys wrote: > >> On 2017-08-04 08:47, Michael Van Canneyt wrote: Is this considered a bug or "by design"? >>> >>> This is by design. >>> As you said, whitespace is not so

Re: [fpc-pascal] Subclassing generic records?

2017-07-17 Thread Sven Barth via fpc-pascal
Am 17.07.2017 18:24 schrieb "Ryan Joseph" : > > I’m trying to find a way to extend generic records since (as far as I know) there is no subclassing of records. I could use variant records here but these don’t work with generics so I tried record helpers and properties

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-10 Thread Sven Barth via fpc-pascal
Am 10.07.2017 15:46 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-07-10 13:34, Dmitry Boyarintsev wrote: >> >> are you referring to "Catching More Than One Type of Exception with One >> Exception Handler" in >>

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Sven Barth via fpc-pascal
On 06.07.2017 16:13, Graeme Geldenhuys wrote: > Imagine if FPC had type inference and multi-line strings, neither very > exotic features. The code then becomes: > > = > var query := '''SELECT Customers.CustomerName, Orders.OrderID > FROM Customers > FULL

Re: [fpc-pascal] If vs case or something else?

2017-07-06 Thread Sven Barth via fpc-pascal
On 06.07.2017 18:33, James Richters wrote: > I can use case statement with strings apparently now, but the thing is, I > create this file myself in an earlier stage, so I do not need to create the > file with strings at all, I could use some codes and do something like this: "case of String"

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-10 Thread Sven Barth via fpc-pascal
Am 10.07.2017 13:19 schrieb "Michael Van Canneyt" : > > > > On Mon, 10 Jul 2017, Felipe Monteiro de Carvalho wrote: > >> On Mon, Jul 10, 2017 at 1:08 PM, Michael Van Canneyt >> wrote: >>> >>> The code is definitely not the same. In each case, it was

Re: [fpc-pascal] Static local variables available?

2017-07-20 Thread Sven Barth via fpc-pascal
Am 20.07.2017 13:01 schrieb "Bo Berglund" : > > On Thu, 20 Jul 2017 11:11:50 +0200, Maciej Izak > wrote: > > >2017-07-20 11:03 GMT+02:00 Bo Berglund : > > > >> So since I don't really want to use a global, is it possible to > >>

Re: [fpc-pascal] Static local variables available?

2017-07-20 Thread Sven Barth via fpc-pascal
On 20.07.2017 11:11, Maciej Izak wrote: > 2017-07-20 11:03 GMT+02:00 Bo Berglund >: > > So since I don't really want to use a global, is it possible to > declare a local variable static in the sense that it retains its > values

Re: [fpc-pascal] Subclassing generic records?

2017-07-20 Thread Sven Barth via fpc-pascal
On 17.07.2017 19:20, Ryan Joseph wrote: > >> On Jul 17, 2017, at 10:58 AM, Sven Barth via fpc-pascal >> <fpc-pascal@lists.freepascal.org> wrote: >> >> I'll need to check whether Delphi allows that for helpers (doesn't matter >> whethe

Re: [fpc-pascal] Static local variables available?

2017-07-21 Thread Sven Barth via fpc-pascal
Am 21.07.2017 10:44 schrieb "Santiago A." <s...@ciberpiula.net>: > > El 20/07/2017 a las 15:50, Sven Barth via fpc-pascal escribió: >> >> Am 20.07.2017 13:01 schrieb "Bo Berglund" <bo.bergl...@gmail.com>: >> > >> > On Thu, 20

Re: [fpc-pascal] Sistema grande em CGI

2017-07-21 Thread Sven Barth via fpc-pascal
Am 21.07.2017 13:33 schrieb "Rogério Martins" : > > Bom dia pessoal ! > > Alguém aí já desenvolveu algum sistema grande em cgi ? (muitos acessos simultâneos, etc) > > Queria saber se ele dá conta, ou até onde se pode ir. > Eu só fiz aplicações pequenas. > > Obrigado This is

Re: [fpc-pascal] Subclassing generic records?

2017-07-21 Thread Sven Barth via fpc-pascal
Am 21.07.2017 23:36 schrieb "Ryan Joseph" : > > Thanks Sven, that’s one way around it. > > So is it by design that records don’t have inheritance or is this planned? Yes, that's by design and there are no plans to change this. > and is it also by design that classes

Re: [fpc-pascal] Best way to insert bytes into a TBytes variable?

2017-07-27 Thread Sven Barth via fpc-pascal
Am 27.07.2017 17:18 schrieb : > > On 2017-07-25 11:00, Martok wrote: >>> >>> Ideally the function should be portable between FPC and Delphi XE5... >> >> You'd only need your own functions for Delphi, FPC's intrinsics such as Insert() >> can already work with arrays: >> >> var >>

Re: [fpc-pascal] Best way to insert bytes into a TBytes variable?

2017-07-26 Thread Sven Barth via fpc-pascal
Am 26.07.2017 10:59 schrieb "Martok" : > > > Ideally the function should be portable between FPC and Delphi XE5... > You'd only need your own functions for Delphi, FPC's intrinsics such as Insert() > can already work with arrays: > > var > b, c: TBytes; > begin > b:=

Re: [fpc-pascal] Semaphores removed from the rtl?

2017-07-19 Thread Sven Barth via fpc-pascal
Am 19.07.2017 18:45 schrieb "Anthony Walter" : > > Nah thanks, I can implement them with native functions on windows, mac, and linux easily enough and with $ifdefs. I am just surprised by the thought process involved in removing them. As Charlie said, that functionality was

Re: [fpc-pascal] Delete and Add for TBytes?

2017-07-12 Thread Sven Barth via fpc-pascal
Am 12.07.2017 16:08 schrieb "Bo Berglund" : > To remove Count processed bytes from the beginning: > > Buffer: AnsiString; > > Delete(Buffer, 1, Count) > or worse: > Buffer := Copy(Buffer, Count+1, Length(Buffer)); FPC trunk supports Delete() and Insert() on dynamic arrays

Re: [fpc-pascal] Running Freepascal programs on other computers

2017-06-29 Thread Sven Barth via fpc-pascal
Am 29.06.2017 23:27 schrieb "Bo Berglund" <bo.bergl...@gmail.com>: > > On Thu, 29 Jun 2017 11:08:40 +0200, Sven Barth via fpc-pascal > <fpc-pascal@lists.freepascal.org> wrote: > > >- open "Internet Options" > > The wording on these op

Re: [fpc-pascal] Running Freepascal programs on other computers

2017-06-29 Thread Sven Barth via fpc-pascal
Am 28.06.2017 20:32 schrieb "James Richters" : > > >Are you by chance running it from a shared smb folder or something like that? > > Yes I am running them on a network share… If I copy the file to my laptop hard drive then I don’t get the warning anymore. However

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Sven Barth via fpc-pascal
Am 06.07.2017 23:34 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-07-06 20:07, Dmitry Boyarintsev wrote: >> >> The thread of discussion: >> http://lists.freepascal.org/pipermail/fpc-devel/2016-February/036709.html > > > > Thanks for the link. Seems this topic has

Re: [fpc-pascal] Record operator for assignment

2017-04-28 Thread Sven Barth via fpc-pascal
Am 28.04.2017 14:09 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > Is there any way that the length of an array being used for that sort of job can be defined by what's put into it, rather than having to be predefined? No, there is not. Though I already had the idea that

Re: [fpc-pascal] Record operator for assignment

2017-04-28 Thread Sven Barth via fpc-pascal
Am 28.04.2017 09:23 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > On Apr 28, 2017, at 1:06 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > No, I mean > > > > rec := (x + y) * 2; > >

Re: [fpc-pascal] Record operator for assignment

2017-04-27 Thread Sven Barth via fpc-pascal
Am 28.04.2017 06:06 schrieb "Ryan Joseph" : > > Instead of making constructors and doing busy work It would be nice if Free Pascal could let you assign records outside of type blocks like: > > rec := (x: 0; y: 0; z: 0); > > Why isn’t this possible btw? I saw some C++

Re: [fpc-pascal] Record operator for assignment

2017-04-28 Thread Sven Barth via fpc-pascal
On 28.04.2017 08:01, Ryan Joseph wrote: > >> On Apr 28, 2017, at 12:43 PM, Sven Barth via fpc-pascal >> <fpc-pascal@lists.freepascal.org> wrote: >> >> It would introduce an ambiguity as "(x" could also complete to other >> expressions (e.g. &quo

Re: [fpc-pascal] Const attributes

2017-07-30 Thread Sven Barth via fpc-pascal
On 30.07.2017 20:55, Marcos Douglas B. Santos wrote: > On Sun, Jul 30, 2017 at 1:46 PM, Maciej Izak wrote: >> 2017-07-30 18:37 GMT+02:00 Marcos Douglas B. Santos : >>> >>> 1. Is this by design? >> >> >> Yes. To disallow this you need to use {$J-} directive. >

Re: [fpc-pascal] Best way to insert bytes into a TBytes variable?

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 12:37 schrieb "Bo Berglund" <bo.bergl...@gmail.com>: > > On Sun, 30 Jul 2017 09:33:59 +0200, Sven Barth via fpc-pascal > <fpc-pascal@lists.freepascal.org> wrote: > > >> The application was started back in Delphi7 times when "string"

Re: [fpc-pascal] inline callback functions?

2017-08-09 Thread Sven Barth via fpc-pascal
Am 09.08.2017 06:21 schrieb "Ryan Joseph" : > > > > On Aug 7, 2017, at 1:47 PM, Mattias Gaertner wrote: > > > > What you mean are "anonymous functions" or "closures". > > > > State in FPC: > >

Re: [fpc-pascal] Defining sonames?

2017-08-17 Thread Sven Barth via fpc-pascal
Am 17.08.2017 22:20 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-08-17 16:52, Martin Schreiber wrote: >> >> Exactly. So why not use the SONAME in the Pascal binding unit instead to use >> the base name as Free Pascal currently does in xlib.pp for example? > > > I

Re: [fpc-pascal] Defining sonames?

2017-08-16 Thread Sven Barth via fpc-pascal
On 14.08.2017 15:19, Fred van Stappen wrote: > A concrete example. > > A Linux/FreeBSD fpc release was compiled using the pascal headers for > libX11.so.6 and using symlink libX11.so >> libX11.so.6.0.8. > > This release was installed on a system (with libX11-dev too to make it > work). > > If,

Re: [fpc-pascal] Defining sonames?

2017-08-17 Thread Sven Barth via fpc-pascal
Am 18.08.2017 01:17 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-08-17 21:47, Henry Vermaak wrote: >> >> You can use -l:libgreat.so.1 with gcc to link to a specific library version >> (iirc). > > > I'll have to take your word for it Henry, as I don't know GCC much -

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-22 Thread Sven Barth via fpc-pascal
Am 22.08.2017 18:11 schrieb "Peter" : > > Hi James, > > Its unlikely that 999.999 has an EXACT representation in floating point. > > 999.999002 maybe the closest value at your chosen precision. > > Extended type has more precision, but still probably won't be

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 02:04 schrieb "Anthony Walter" : > > I just wanted to point out that revision 37023 Sven added type helper support for interfaces. > > Good job and thank you Sven! You're welcome. I wanted to add them for some time already :) Regards, Sven

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 09:42 schrieb "Michael Van Canneyt" : > > > > On Tue, 22 Aug 2017, Anthony Walter wrote: > >> I just wanted to point out that revision 37023 Sven added type helper >> support for interfaces. >> >> Good job and thank you Sven! >> > > I'm having trouble

Re: [fpc-pascal] Defining sonames?

2017-08-17 Thread Sven Barth via fpc-pascal
Am 17.08.2017 15:49 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-08-16 18:14, Sven Barth via fpc-pascal wrote: >> >> As you can see the program will work correctly as long as the >> libX11.so.6 file exists (even though that is

Re: [fpc-pascal] Vehicle management

2017-05-12 Thread Sven Barth via fpc-pascal
Am 12.05.2017 11:10 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > On 05/11/2017 09:37 AM, Sven Barth via fpc-pascal wrote:>> Am 11.05.2017 > >> 18:14 schrieb "Jon Foster" <jon-li...@jfpossibilities.com > >> <mai

Re: [fpc-pascal] FPC Graphics options?

2017-05-15 Thread Sven Barth via fpc-pascal
Am 14.05.2017 23:18 schrieb : > > On 2017-05-11 18:57, Jon Foster wrote: >> >> On 05/11/2017 02:48 PM, Graeme Geldenhuys wrote: >>> >>> On 2017-05-11 19:43, James Richters wrote: Any Suggestions? >>> >>> >>> Speed: >>> In recent graphics work I've done, I've noticed

Re: [fpc-pascal] Vehicle management

2017-05-11 Thread Sven Barth via fpc-pascal
Am 11.05.2017 18:14 schrieb "Jon Foster" : > I should also throw out here that it would be *REALLY* nice, and even somewhat needful on the Android front, if FPC could interface directly with C++ libs and use their classes and objects. Besides Java, Google prefers to

Re: [fpc-pascal] Call for testing: array constructors

2017-05-09 Thread Sven Barth via fpc-pascal
Am 08.05.2017 22:14 schrieb "Jonas Maebe" <jo...@freepascal.org>: > > On 08/05/17 17:34, Sven Barth via fpc-pascal wrote: >> >> Good to know. Any regressions with ordinary sets? > > > There seems to be a problem with overload selection between dynamic

Re: [fpc-pascal] FPC Graphics options?

2017-05-16 Thread Sven Barth via fpc-pascal
Am 16.05.2017 16:10 schrieb "Jon Foster" : > There are only two software projects in the world that continue to impress me with each new release: the Linux Kernel and FPC, which amuses me since I remember the first version of FPC I saw. '99 I think it was. I laughed

Re: [fpc-pascal] Best way to check SimpleIPC for messages

2017-05-16 Thread Sven Barth via fpc-pascal
Am 17.05.2017 07:08 schrieb : > > On 2017-05-15 04:36, Michael Schnell wrote: >> >> On 12.05.2017 16:37, Michael Van Canneyt wrote: >>> >>> >>> Check manually. What else is left ? There is no message queue, so no loop in which to check at regular basis. >>> >> For event

  1   2   3   4   5   6   7   8   9   10   >