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

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 19:40 schrieb "Anthony Walter" : > > Sven, multiple helpers would be greatly appreciated, especially considering everyone wants to add their own helpers for types like string. At least in FPC modes they can use inheritance to solve this (see below) or by putting their units after the

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

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 19:39 schrieb "Marcos Douglas B. Santos" : > > On Wed, Aug 23, 2017 at 11:00 AM, Anthony Walter wrote: > > Marco, it doesn't work that way. > > > > Type helpers simply allow you to extend an existing type with new methods > > and/or properties. When you declare a type helper you exte

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

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 16:01 schrieb "Anthony Walter" : > > Marco, it doesn't work that way. > > Type helpers simply allow you to extend an existing type with new methods and/or properties. When you declare a type helper you extend all instances of said type given that: > > A) You 'use' the unit declaring t

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

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 16:59 schrieb "Marcos Douglas B. Santos" : > > On Wed, Aug 23, 2017 at 11:07 AM, Anthony Walter wrote: > > Here is another example: > > > > type > > TDay = (Monday = 0, Tuesday, Wednesday, Thursday, Friday, Saturday, > > Sunday); > > > > TDayHelper = record helper for TDay > >

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

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 16:58 schrieb "Marcos Douglas B. Santos" : > > On Wed, Aug 23, 2017 at 11:00 AM, Anthony Walter wrote: > > Marcos, it doesn't work that way. > > > > Type helpers simply allow you to extend an existing type with new methods > > and/or properties. When you declare a type helper you ext

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 understanding why this could be u

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

2017-08-22 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] 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 exact. Additionally Extended

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-21 Thread Sven Barth via fpc-pascal
Am 22.08.2017 00:02 schrieb "James Richters" : The others already wrote about floating point precision, so I won't repeat that. > The reason I noticed this is because I have some conditional statements like > If Draw_GX_Min<>99.999 then > Something *DON'T* compare floating point numbers

Re: [fpc-pascal] TStringHelper missing

2017-08-21 Thread Sven Barth via fpc-pascal
Am 21.08.2017 13:51 schrieb "Sven Barth" : > > Am 21.08.2017 08:23 schrieb "Michael Van Canneyt" : > > > > > > > > On Mon, 21 Aug 2017, Ryan Joseph wrote: > > > >> I’m trying to split a string by a delimiter and see there is a type h

Re: [fpc-pascal] TStringHelper missing

2017-08-21 Thread Sven Barth via fpc-pascal
r.Split(' ‘); >> >> >> What am I doing wrong? > > > Try > > var > Str : AnsiString; > or > Str : WideString; > > I believe the compiler has some trouble finding the helper if you use the > 'string' alias. I think there is even a

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 - onl

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 forked

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] 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, s

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" : > > > > On Tue, 15 Aug 2017, Sven Barth via fpc-pascal wrote: > >> Am 15.08.2017 11:17 schrieb "Michael Van Canneyt" : >>> >>> >>> >>> >>> On Mon, 14 Aug

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 well defined. >> >> >> >

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 likely have little use fo

Re: [fpc-pascal] inline callback functions?

2017-08-08 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: > > http://lists.freepascal.org/pipermail/fpc-devel/2016-August/037328.html > > Yes, closures. Seems like dev

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. > > I know that we can use this "hack"

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" : > > On Sun, 30 Jul 2017 09:33:59 +0200, Sven Barth via fpc-pascal > wrote: > > >> The application was started back in Delphi7 times when "string" > >> actually meant AnsiString and was a 1-byte

Re: [fpc-pascal] BlockWrite of dynamic arrays

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 08:21 schrieb "Bo Berglund" : > 3) Change the BlockWrite command from > BlockWrite(F, Buffer[1], Length(Buffer)); > to > BlockWrite(F, Buffer, Length(Buffer)); > > Note that I would like to *not* specify the index of the first element > of the array so that the same code can work for

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 08:07 schrieb "Bo Berglund" : > > On Fri, 28 Jul 2017 16:35:05 +0200, Michael Schnell > wrote: > > >On 25.07.2017 10:54, Bo Berglund wrote: > >> so I need to write efficient replacements for certain string functions (Delete, Insert, Copy etc). > >Why do you think the string functio

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 De

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. > FPC has just 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 >> b, c: TBytes; >>

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:= TBytes.Create(1,2,3); > c

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 don’t allow operator overloads

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 an English list, so ple

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." : > > El 20/07/2017 a las 15:50, Sven Barth via fpc-pascal escribió: >> >> Am 20.07.2017 13:01 schrieb "Bo Berglund" : >> > >> > On Thu, 20 Jul 2017 11:11:50 +0200, Maciej Izak >&g

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 > >> declare a local variable static in the sense that it retains its > >>

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 >> wrote: >> >> I'll need to check whether Delphi allows that for helpers (doesn't matter >> whether the extended type is a specialization or no

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 across calls to the procedu

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 never intended for publ

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 to basically rename the x/y va

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 (TBytes is merely a dynam

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 >> https://docs.oracle.com/javase/tutorial/essential/exceptions

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 measured. There is >>> a 10% performance loss. >

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 already

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" is

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 OUT

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" : > > On Thu, 29 Jun 2017 11:08:40 +0200, Sven Barth via fpc-pascal > wrote: > > >- open "Internet Options" > > The wording on these option pages seem to indicate that they are for > websites. That is all the

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 I still get the secutiy warning i

Re: [fpc-pascal] SIGSEGV in fpc_check_object

2017-06-14 Thread Sven Barth via fpc-pascal
Am 14.06.2017 11:13 schrieb "Gabor Boros" : > > 2017. 06. 14. 10:28 keltezéssel, José Mejuto írta: >> >> That's wrong for sure, x is not initialized to nil, not in Linux nor in Windows. > > > With the below code caption of the form not changed on Linux for me. > > > procedure TForm1.FormCreate(Send

Re: [fpc-pascal] GDBServer

2017-06-01 Thread Sven Barth via fpc-pascal
Am 01.06.2017 16:49 schrieb "Dimitrios Chr. Ioannidis via fpc-pascal" < fpc-pascal@lists.freepascal.org>: > > Hi, > > I'm trying to "convince" gdbserver ( not gdb ) to attach to a windows service, but I'm always get the "Attach to process failed (error 5): Access is denied. " . > > Did anyone s

Re: [fpc-pascal] named parameter

2017-05-29 Thread Sven Barth via fpc-pascal
Am 29.05.2017 10:26 schrieb "Ryan Joseph" : > > > > On May 29, 2017, at 1:01 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > If anything like this would be implemented, then the already existing syntax (for variant

Re: [fpc-pascal] named parameter

2017-05-28 Thread Sven Barth via fpc-pascal
Am 29.05.2017 07:13 schrieb "Ryan Joseph" : > > > > On May 28, 2017, at 5:22 PM, Mark Morgan Lloyd < markmll.fpc-pas...@telemetry.co.uk> wrote: > > > >> IMO though it does improve readability in long functions with lots of > >> parameters, like windows api style procedures that have 5 or more > >>

Re: [fpc-pascal] Why casting interface as Tobject will result in a different reference?

2017-05-27 Thread Sven Barth via fpc-pascal
2017-05-27 18:10 GMT+02:00 Dennis Poon : > > > Sven Barth via fpc-pascal wrote: >> >> The idea itself is valid, cause "(IMyInterfaceVar as TObject) as >> IMyInterface = IMyInterfaceVar" is true if and only if IMyInterface is >> a COM interface. If IMyInte

Re: [fpc-pascal] named parameter

2017-05-27 Thread Sven Barth via fpc-pascal
2017-05-27 16:12 GMT+02:00 Michael Van Canneyt : > > > On Sat, 27 May 2017, Sven Barth via fpc-pascal wrote: > >> 2017-05-27 9:54 GMT+02:00 Michael Van Canneyt : >>> >>> >>> >>> On Sat, 27 May 2017, Mr Bee via fpc-pascal wrote: >>> &g

Re: [fpc-pascal] named parameter

2017-05-27 Thread Sven Barth via fpc-pascal
2017-05-27 9:54 GMT+02:00 Michael Van Canneyt : > > > On Sat, 27 May 2017, Mr Bee via fpc-pascal wrote: > >> Hi, >> >> As Pascal mostly well known as a safe, easy to read, and elegant language, >> don't you think Pascal needs named parameter? I mean for ALL kind of >> parameters, not just for Varia

Re: [fpc-pascal] Why casting interface as Tobject will result in a different reference?

2017-05-26 Thread Sven Barth via fpc-pascal
2017-05-26 11:08 GMT+02:00 Michael Van Canneyt : > > > On Fri, 26 May 2017, Dennis wrote: > >> I defined a generic TList //CORBA style interface >> >> var >>aInt : IMyInterface; >> aObj : TObject; >> begin >>aInt := MyList.Items[0]; >>aObj := aInt as TObject; >> >> writeln( IntToH

Re: [fpc-pascal] download mirror is missing

2017-05-26 Thread Sven Barth via fpc-pascal
2017-05-25 17:22 GMT+02:00 Marco van de Voort : > In our previous episode, Sven Barth via fpc-pascal said: >> > >> > In particular, avoid these languages: >> > https://www.destroyallsoftware.com/talks/wat >> >> I'd say if he decides to use JS he&#x

Re: [fpc-pascal] download mirror is missing

2017-05-25 Thread Sven Barth via fpc-pascal
2017-05-25 17:05 GMT+02:00 Michael Van Canneyt : > > > On Thu, 25 May 2017, Marco van de Voort wrote: > >> In our previous episode, Michael Van Canneyt said: >>> >>> > Simply replacing the tcl bits would be enough. It seems a simple >>> > makefile >>> > generator app. >>> >>> No way. I'm going to g

Re: [fpc-pascal] download mirror is missing

2017-05-25 Thread Sven Barth via fpc-pascal
2017-05-25 16:44 GMT+02:00 Marco van de Voort : >> The current system is confusing and completely un-understandable, it needs >> to go. >> >> The multi-language support has not been used in 15 years, so it is time to >> put it out of its misery... > > Please avoid non general skills (in FPC core,

Re: [fpc-pascal] Browser and exe

2017-05-25 Thread Sven Barth via fpc-pascal
2017-05-25 15:14 GMT+02:00 Marcos Douglas B. Santos : > On Wed, May 24, 2017 at 4:23 PM, Graeme Geldenhuys > wrote: >>> 2. How did you garantee that others applications aren't being using >>> the same port as your application to avoind conflicts? >> >> >> I looked at the official IANA list of regi

Re: [fpc-pascal] download mirror is missing

2017-05-25 Thread Sven Barth via fpc-pascal
Am 25.05.2017 11:16 schrieb "Michael Van Canneyt" : > > > > On Thu, 25 May 2017, Mattias Gaertner wrote: > >> On Wed, 24 May 2017 22:24:51 +0200 (CEST) >> mar...@stack.nl (Marco van de Voort) wrote: >> >>> In our previous episode, Mattias Gaertner said: >>> > > https://www.freepascal.org/down/x86_6

Re: [fpc-pascal] FPC Graphics options?

2017-05-20 Thread Sven Barth via fpc-pascal
On 20.05.2017 21:34, Jonas Maebe wrote: > There's at least one minor twist of the classic "C compiler evaluates > constant stuff at compile time": > 1) oy and oz are constant. The "floor" function is a standard C library > function, and hence C compilers know what it does and can evaluate it at > c

Re: [fpc-pascal] FPC Graphics options?

2017-05-19 Thread Sven Barth via fpc-pascal
Am 19.05.2017 22:24 schrieb "Sven Barth" : > > On 19.05.2017 19:22, Karoly Balogh (Charlie/SGR) wrote: > > Hi, > > > > On Fri, 19 May 2017, Sven Barth via fpc-pascal wrote: > > > >> I think Jeppe wanted to add vector support. Though the question

Re: [fpc-pascal] FPC Graphics options?

2017-05-19 Thread Sven Barth via fpc-pascal
On 19.05.2017 19:22, Karoly Balogh (Charlie/SGR) wrote: > Hi, > > On Fri, 19 May 2017, Sven Barth via fpc-pascal wrote: > >> I think Jeppe wanted to add vector support. Though the question here is >> whether one wants to optimize/detect this at the AST level and con

Re: [fpc-pascal] FPC Graphics options?

2017-05-19 Thread Sven Barth via fpc-pascal
Am 19.05.2017 16:39 schrieb "Karoly Balogh (Charlie/SGR)" < char...@scenergy.dfmk.hu>: > > Hi, > > On Fri, 19 May 2017, Reimar Grabowski wrote: > > > Final: The render function takes about 90%, the cast-to-int about 5%. No > > other interesting functions shown. So the missing time must be spent > >

Re: [fpc-pascal] FPC Graphics options?

2017-05-19 Thread Sven Barth via fpc-pascal
Am 19.05.2017 15:29 schrieb "Marco van de Voort" : > > In our previous episode, Sven Barth via fpc-pascal said: > > > > You only compiled the program with SSE, but not the RTL. And to completely > > avoid the x87 FPU you additionally need to fiddle around wit

Re: [fpc-pascal] FPC 64bit for windows

2017-05-19 Thread Sven Barth via fpc-pascal
Am 19.05.2017 14:53 schrieb "Lukasz Sokol" : > > On 19/05/17 13:33, Sven Barth via fpc-pascal wrote: > > >>> You don't have to build a 32-bit FPC because an official > >>> released installer exists. So this is no problem at all. But > >>>

Re: [fpc-pascal] FPC Graphics options?

2017-05-19 Thread Sven Barth via fpc-pascal
Am 19.05.2017 12:51 schrieb "Mattias Gaertner" : > > On Fri, 19 May 2017 10:54:25 +0200 > Sven Barth via fpc-pascal wrote: > > >[...] > > Even though FPC might use SSE for maths it will still use the x87 to > > transfer floating values to/from function,

Re: [fpc-pascal] FPC Graphics options?

2017-05-19 Thread Sven Barth via fpc-pascal
Am 19.05.2017 13:32 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-05-19 12:11, Nikolay Nikolov wrote: >> >> In FPC, if you want to use SSE and >> avoid the x87 FPU, you have to compile with a specific compiler options >> and forfeit the option for your executable to run

Re: [fpc-pascal] FPC 64bit for windows

2017-05-19 Thread Sven Barth via fpc-pascal
Am 19.05.2017 13:54 schrieb "Lukasz Sokol" : > > On 19/05/17 11:15, Graeme Geldenhuys wrote: > > On 2017-05-19 00:38, Nikolay Nikolov wrote: > >> windows OS - there are simply no known issues with that under any > >> 64-bit windows version that I know of. snip... It won't work > >> from the IDE

Re: [fpc-pascal] FPC Graphics options?

2017-05-19 Thread Sven Barth via fpc-pascal
Am 19.05.2017 03:30 schrieb "Ryan Joseph" : > > > > On May 19, 2017, at 3:48 AM, Florian Klämpfl wrote: > > > > Well, the reason are the linux calling conventions: there are no callee saved xmm registers. This > > means FPC does not use any single/double register variables. I have some prototype f

Re: [fpc-pascal] FPC 64bit for windows

2017-05-18 Thread Sven Barth via fpc-pascal
Am 19.05.2017 02:22 schrieb "James Richters" : > > Thank you for the explanation. I didn't really understand how to use the cross compiler. > > I have installed the cross compiler and tried to compile my program with > > ppcrossx64 program.pas > > but I get > PaStep.pas(3,98) Fatal: Can't find uni

Re: [fpc-pascal] List pre-defined defines

2017-05-18 Thread Sven Barth via fpc-pascal
Am 18.05.2017 22:01 schrieb "Marco van de Voort" : > > In our previous episode, Sven Barth via fpc-pascal said: > > > > fpc -vc NUL > > > > But I assume that requires executing a shell? If I remember correctly it should not (though I c

Re: [fpc-pascal] List pre-defined defines

2017-05-18 Thread Sven Barth via fpc-pascal
Am 18.05.2017 17:47 schrieb "Jon Foster" : > > On 05/18/2017 08:46 AM, Jon Foster wrote: >> >> >> On 05/17/2017 05:40 AM, Ewald wrote: >>> >>> On 16/05/17 23:53, Mattias Gaertner wrote: touch mytest fpc -vc mytest >>> >>> Perhaps a one-liner: >>> fpc -vc /dev/null >>> >>> ? >>> >

Re: [fpc-pascal] FPC Graphics options?

2017-05-16 Thread Sven Barth via fpc-pascal
Am 17.05.2017 07:18 schrieb : > > On 2017-05-15 17:37, James Richters wrote: >> >> I have managed to get ptcgraph and ptccrt to work with my program and >> I can report that there is an AMAZING increase in graphics >> performance! It is pretty much a drop in replacement and I did not >> change an

Re: [fpc-pascal] FPC Graphics options?

2017-05-16 Thread Sven Barth via fpc-pascal
Am 17.05.2017 07:15 schrieb : > > On 2017-05-16 09:10, Jon Foster wrote: > >> I think the key word in Graeme's complaint is "game". And I'm willing >> to bet that most of his envisioned gaming scenarios deal with a lot of >> floating point math and the more advanced math functions. A quick >> glanc

Re: [fpc-pascal] FPC Graphics options?

2017-05-16 Thread Sven Barth via fpc-pascal
Am 17.05.2017 07:12 schrieb : > > On 2017-05-15 17:27, Graeme Geldenhuys wrote: >> >> On 2017-05-15 22:50, nore...@z505.com wrote: >>> >>> Graeme will need to clarify whether he was trying to be harsh on FPC >>> entirely, or just specifically in some areas.. :-) >> >> >> I'll try and clarify... I b

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 processing in a not threaded

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 and moved on. I wish I had the t

Re: [fpc-pascal] FPC Graphics options?

2017-05-15 Thread Sven Barth via fpc-pascal
Am 16.05.2017 02:46 schrieb "Nikolay Nikolov" : >> I also no longer have the 'graphwindow' handle variable so I had to comment out anything that was using it like >> >> SetWindowTextA(graphicwindow,graphwindowtext); >> And >> ShowWindow(graphwindow, SW_SHOW); >> So I just commented them out for now

Re: [fpc-pascal] FPC Graphics options?

2017-05-14 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 that FPC is fantasti

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" >> <mailto:jon-li...@jfpossibilities

Re: [fpc-pascal] FPC Graphics options?

2017-05-11 Thread Sven Barth via fpc-pascal
On 11.05.2017 20:43, James Richters wrote: > I have a few console graphics applications that I originally wrote in > Turbo Pascal that I have been able to convert over to Free Pascal and > now have windows versions of these programs. I notice that unless I run > my program on a 3.5GHz machine or f

Re: [fpc-pascal] Vehicle management

2017-05-11 Thread Sven Barth via fpc-pascal
On 11.05.2017 19:58, Jon Foster wrote: > > On 05/11/2017 09:37 AM, Sven Barth via fpc-pascal wrote: >> >> Am 11.05.2017 18:14 schrieb "Jon Foster" >> mailto:jon-li...@jfpossibilities.com>>: >> > Anyhow tips on the FPC->C++ front would be appreci

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 use C++ (for obvious reasons) an

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

2017-05-08 Thread Sven Barth via fpc-pascal
Am 08.05.2017 22:14 schrieb "Jonas Maebe" : > > 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 and open arr

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

2017-05-08 Thread Sven Barth via fpc-pascal
Am 08.05.2017 18:25 schrieb "Mattias Gaertner" : > > On Fri, 5 May 2017 00:06:25 +0200 > Sven Barth via fpc-pascal wrote: > > >[...] > > Since revision 36105 FPC now supports the use of array constructors > > using the "[...]" syntax inside o

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

2017-05-08 Thread Sven Barth via fpc-pascal
Am 08.05.2017 16:34 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > On 04/05/17 22:30, Sven Barth via fpc-pascal wrote: >> >> Hello together! >> Since revision 36105 FPC now supports the use of array constructorsusing the "[

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

2017-05-05 Thread Sven Barth via fpc-pascal
Am 05.05.2017 21:19 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > On 04/05/17 22:30, Sven Barth via fpc-pascal wrote: >> >> Hello together! >> Since revision 36105 FPC now supports the use of array constructorsusing the "[

[fpc-pascal] Call for testing: array constructors

2017-05-04 Thread Sven Barth via fpc-pascal
Hello together! Since revision 36105 FPC now supports the use of array constructors using the "[...]" syntax inside ordinary code blocks like Delphi does since - I think - XE8. And yes, even nested ones are supported (take a look at $fpcdir/tests/test/tarrconstr5.pp for a bit of inspiration). Con

Re: [fpc-pascal] Record operator for assignment

2017-05-04 Thread Sven Barth via fpc-pascal
Am 04.05.2017 10:37 schrieb "Ryan Joseph" : > > > > On Apr 28, 2017, at 3:51 PM, Ryan Joseph wrote: > > > > I almost struck out there. ;) There’s at least a possibility for anyone interested. A few years ago I looked at the compiler source and decided it was beyond me to even understand the code b

Re: [fpc-pascal] Is there some disadvantages using mode Delphi?

2017-04-29 Thread Sven Barth via fpc-pascal
Am 29.04.2017 23:56 schrieb "Marcos Douglas B. Santos" : > > On Sat, Apr 29, 2017 at 5:23 PM, Marco van de Voort wrote: > > > > In our previous episode, Marcos Douglas B. Santos said: > > > I would like to write some packages that should work in FPC and Delphi. > > > I know that I will need to use

Re: [fpc-pascal] Is there some disadvantages using mode Delphi?

2017-04-29 Thread Sven Barth via fpc-pascal
Am 29.04.2017 22:19 schrieb "Marcos Douglas B. Santos" : > > > On Sat, Apr 29, 2017 at 2:10 PM, Michael Van Canneyt < mich...@freepascal.org> wrote: >> >> >>> Hi, >>> >>> I would like to write some packages that should work in FPC and Delphi. >>> I know that I will need to use {mode delphi} to do t

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 such

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" : > > > > 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; > > > > The compiler has to d

Re: [fpc-pascal] Record operator for assignment

2017-04-27 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 >> wrote: >> >> It would introduce an ambiguity as "(x" could also complete to other >> expressions (e.g. "(x + y) * 2" or even merely &quo

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++ code do this and it seems like

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 : http://bugs.freepascal.org/view.php?id=28832> Indeed it is :) Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:/

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 Value is in range of T

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 makes no sense. Functio

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Sven Barth via fpc-pascal
Am 19.04.2017 11:26 schrieb "Ryan Joseph" : > > > > 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) register values (and setjmp also retur

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 implement coroutines. > > > > Searching for longjmp/

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, nice, you did find

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 writeln('resu

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. "va

<    6   7   8   9   10   11   12   13   14   15   >