Re: [fpc-pascal] Constants in generics

2018-11-10 Thread Sven Barth via fpc-pascal
Am Sa., 10. Nov. 2018, 14:47 hat Ryan Joseph geschrieben: > > > > On Nov 10, 2018, at 7:22 PM, Florian Klämpfl > wrote: > > > > If you "export" a generic taking a const from a unit, this info has to > be stored in the ppu. > > Can you show a test case I could use to see where this is triggered i

Re: [fpc-pascal] Default record const values

2018-11-10 Thread Sven Barth via fpc-pascal
Am Sa., 10. Nov. 2018, 12:44 hat Ryan Joseph geschrieben: > Not quite understanding how that’s not entirely parsed by the time you > assign outside of the record. Even so I would expect it to copy what the > const was able to capture, fully parsed or not. > It's not entirely parsed by the time t

Re: [fpc-pascal] Default record const values

2018-11-10 Thread Sven Barth via fpc-pascal
Am Sa., 10. Nov. 2018, 10:06 hat Ryan Joseph geschrieben: > Should’t this work? This would be a good way to set default record values > but it doesn’t seem to be supported. > TMyRecord is not yet completely parsed. There could be another field located behind the "default" constant. Thus using th

Re: [fpc-pascal] Constants in generics

2018-11-08 Thread Sven Barth via fpc-pascal
Am Fr., 9. Nov. 2018, 03:44 hat Ryan Joseph geschrieben: > > > > On Nov 9, 2018, at 4:28 AM, Florian Klämpfl > wrote: > > > > I like the idea of const in generics, but it needs serious cleanup when > it's working: > > - commit messages like "first commit" are useless > > Those are for github so

Re: [fpc-pascal] Restricted generic param types

2018-11-08 Thread Sven Barth via fpc-pascal
Am Fr., 9. Nov. 2018, 05:48 hat Ryan Joseph geschrieben: > I’m getting a parse error here. It thinks the “U” is another type but in > fact it’s another generic parameter and not related to “T” at all. Is this > a bug? I don’t think the way the parsing works the compiler actually can > discern th

Re: [fpc-pascal] Constants in generics

2018-11-06 Thread Sven Barth via fpc-pascal
Am Di., 6. Nov. 2018, 14:35 hat Ryan Joseph geschrieben: > > > > On Nov 6, 2018, at 8:21 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > First of I'm not a fan of adding support for constants, mainly because > it w

Re: [fpc-pascal] Constants in generics

2018-11-06 Thread Sven Barth via fpc-pascal
Am Di., 6. Nov. 2018, 08:44 hat Ryan Joseph geschrieben: > I implemented a first draft of constants (integers) in generics. My reason > was specifically that I wanted a way to add methods to static arrays and > generic records is the only way to accomplish this AFAIK. > > If I fix this up will it

Re: [fpc-pascal] Windows programming tutorials for FPC

2018-11-04 Thread Sven Barth via fpc-pascal
Am Sa., 3. Nov. 2018, 23:56 hat Tomas Hajny geschrieben: > On Sat, November 3, 2018 23:04, James wrote: > > Thanks for the suggestion... > > > > I put my code in the OnCreate event as you suggested, but when I try to > > compile it, I get wrong number of parameters specified for call to > > Assig

Re: [fpc-pascal] fphttpclient.post

2018-10-31 Thread Sven Barth via fpc-pascal
Ched schrieb am Mi., 31. Okt. 2018, 23:43: > Hello All, > > I'm using fphttpclient.simpleget to make querries to webserver. It's very > very simple to use this > function ! "Du pur bonheur". > > As some data which travel the world encoded in clear in the url of the get > are sometime private > (c

Re: [fpc-pascal] Case statements without constants?

2018-10-29 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mo., 29. Okt. 2018, 10:41: > I tried today to make a case that used variables instead of constants and > was surprised to get an error. I’m sure this been true since the 80’s but > why don’t cases allow variables??? I thought a case statement was just a > group of if..else

Re: [fpc-pascal] instance memory usage

2018-10-24 Thread Sven Barth via fpc-pascal
Am 20.10.2018 um 20:09 schrieb Marc Santhoff: Hi, from testing a while ago I remember the following: The memory used by a class instance is composed of 1. the size ".instanceSize()" gives back 2. the memory used by other variables and maybe class instances referenced by pointers and owned b

Re: [fpc-pascal] Where can I download the fpc 3.0.0 seed compiler for Linux on i386 x64?

2018-10-23 Thread Sven Barth via fpc-pascal
Bo Berglund schrieb am Di., 23. Okt. 2018, 18:59: > On Tue, 23 Oct 2018 18:12:41 +0200, Bo Berglund > wrote: > > > >sudo apt-get install -y libx11-dev libgdk-pixbuf2.0-dev libcairo2-dev > >gir1.2-coglpango-1.0 libpangox-1.0-dev xorg-dev libgtk2.0-dev > >libpango1.0-dev > > > >Is this what I need

Re: [fpc-pascal] Where can I download the fpc 3.0.0 seed compiler for Linux on i386 x64?

2018-10-23 Thread Sven Barth via fpc-pascal
Bo Berglund schrieb am Di., 23. Okt. 2018, 18:13: > On Tue, 23 Oct 2018 17:08:40 +0200, Sven Barth via fpc-pascal > wrote: > > >Why don't you simply use the distribution independent release of 3.0.4? > > But I was under the impression that I cannot build 3.0.4 from sou

Re: [fpc-pascal] Where can I download the fpc 3.0.0 seed compiler for Linux on i386 x64?

2018-10-23 Thread Sven Barth via fpc-pascal
Bo Berglund schrieb am Di., 23. Okt. 2018, 17:02: > I want to build FPC/Lazarus (3.0.4/1.8.4) from sources on a new Linux > (Ubuntu 18.04 TLS MATE) using an i386 family CPU. > AFAIK I need to have the fpc seed compiler in order to do this. > > But this is a hen and egg problem, how can I download

Re: [fpc-pascal] Cannot use SQLite 64 bit dll

2018-10-20 Thread Sven Barth via fpc-pascal
Am 19.10.2018 um 19:22 schrieb Dennis: Using Lazarus and FPC and sqlite3conn unit, I can use the sqlite3.dll on windows without problem. However, when I try to convert my project to win 64, it just fail without any warning. I am using     FPC 3.1.1 Revision 63034     Lazarus 1.9.0     both a

Re: [fpc-pascal] Add assembler source file to fpmake package?

2018-10-15 Thread Sven Barth via fpc-pascal
christo schrieb am Mo., 15. Okt. 2018, 21:41: > On 15/10/2018 20:07, Sven Barth via fpc-pascal wrote: > > christo schrieb am Mo., 15. Okt. 2018, 18:22: > >> I'm trying to build a fpmake project for the RTL. > > > Are you aware that the RTL already has a

Re: [fpc-pascal] Add assembler source file to fpmake package?

2018-10-15 Thread Sven Barth via fpc-pascal
christo schrieb am Mo., 15. Okt. 2018, 18:22: > I'm trying to build a fpmake project for the RTL. Are you aware that the RTL already has a fpmake project? It might not be entirely up to date, but it exists. Regards, Sven ___ fpc-pascal maillist - f

Re: [fpc-pascal] Parse strings like "day-1" to convert in a time stamp

2018-10-14 Thread Sven Barth via fpc-pascal
Marcos Douglas B. Santos schrieb am So., 14. Okt. 2018, 16:15: > Do you know any Pascal lib to parse strings to convert in date/time values? > The user is supposed to type human-friendly values like: > - "day"=> trunc(now) > - "day-2" => trunc(now-2) > - "week" => trunc(now-7) > - "yesterday"

Re: [fpc-pascal] Option in Makefile to clean installed compiled units

2018-10-10 Thread Sven Barth via fpc-pascal
Fr0sT schrieb am Mi., 10. Okt. 2018, 13:39: > Hi all, > > when building FPC from sources, I couldn't find a command to cleanup > unit binaries copied to common .\units\ dir by "install" command. > Without this step build process fails. > > I build FPC from sources with the following layout: > > .

Re: [fpc-pascal] Listing the type (even as string) of the parameters and the return of a function

2018-10-09 Thread Sven Barth via fpc-pascal
silvioprog schrieb am Di., 9. Okt. 2018, 19:56: > On Mon, Oct 8, 2018 at 6:21 AM Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > >> Short answer: No. >> >> Long answer: No. The extended RTTI required for that is currently only >>

Re: [fpc-pascal] Listing the type (even as string) of the parameters and the return of a function

2018-10-08 Thread Sven Barth via fpc-pascal
silvioprog schrieb am Mo., 8. Okt. 2018, 10:11: > Hi. > > First, thanks for the great work in the invoke.inc for win64! ☺ > > So, consider the following example: > > uses RTTI; > > type > TFoo = class > public > function Bar(const A: string; B: Integer): string; > end; > > function TFoo

Re: [fpc-pascal] seeing messages?

2018-09-17 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mo., 17. Sep. 2018, 09:46: > I haven’t got a reply in days to some questions I had in the "with in > classes/records” thread, which is unusual. Are people seeing my messages? > Just wanted to make sure the messages aren’t getting lost. > If your last message is the one fro

Re: [fpc-pascal] "No debugger support" in FPC3.0.4 for DOS (go32v2)

2018-09-17 Thread Sven Barth via fpc-pascal
schrieb am Mo., 17. Sep. 2018, 08:11: > I downloaded "dos304full" and did the install. But trying to debug results > in "No debugger support available" > I looked into the sourcecode of the IDE and discovert that the IDE > included > in the downloaded DOS304FULL.zip must have been compiled with "

Re: [fpc-pascal] Concatenating CP Strings

2018-09-16 Thread Sven Barth via fpc-pascal
On 9/15/18 1:38 AM, Martok wrote: > Hi all, > > concatenating codepage strings is documented to be a bit weird: > > > Knowing this, how does one achieve the following? > > - have a string in any dynamic codepage > - append an

Re: [fpc-pascal] Concatenating CP Strings

2018-09-16 Thread Sven Barth via fpc-pascal
On 9/15/18 10:12 PM, Martok wrote: > And another one: > > var > f: TextFile; > s: string; > begin > AssignFile(f, 'a_file.txt'); > SetTextCodePage(f, 866); > Reset(f); > ReadLn(f, s); > WriteLn(StringCodePage(s)); > readln; > end. > > That is rather useless... No, it is not. The

Re: [fpc-pascal] with in classes/records

2018-09-09 Thread Sven Barth via fpc-pascal
Am 09.09.2018 um 16:16 schrieb Michael Van Canneyt: On Sun, 9 Sep 2018, Ryan Joseph wrote: It seems syntacticly possible that default properties could be recursive by having a default property reference a record/class with another default property. Should that be allowed? I don't think so.

Re: [fpc-pascal] with in classes/records

2018-09-06 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 6. Sep. 2018, 16:33: > > > > On Sep 6, 2018, at 9:25 PM, Michael Van Canneyt > wrote: > > > > No, the whole point of default is that they should be for any kind of > field. > > For example if you want a nullable boolean, you'll do something like > > > > Type > >TN

Re: [fpc-pascal] with in classes/records

2018-09-04 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Di., 4. Sep. 2018, 11:27: > > > > On Sep 4, 2018, at 2:06 PM, Ryan Joseph > wrote: > > > > Sorry I didn’t think enough before I sent this. > > > > We *must* allow this assignment to make operator overloads work. += > operators are also basically assigning TWrapper to TWrap

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Sven Barth via fpc-pascal
On 03.09.2018 09:15, Ryan Joseph wrote: > Thank you for bearing with me, so finally here are my questions: > > 1) Given this is critical to make management operators work smoothly what > does the compiler team think about this idea to have a default property or > “with" in classes/records? > >

Re: [fpc-pascal] Unbuffering I/O

2018-08-29 Thread Sven Barth via fpc-pascal
Am 29.08.2018 um 18:25 schrieb Mark Morgan Lloyd: On 29/08/18 16:00, Henry Vermaak wrote: On Wed, Aug 29, 2018 at 03:01:54PM +, Mark Morgan Lloyd wrote:> I think I've seen this question asked before, my apologies if this was> recently.> > I've got two programs intended to be functionally i

Re: [fpc-pascal] How is interface variable implemented?

2018-08-25 Thread Sven Barth via fpc-pascal
Dennis schrieb am Fr., 24. Aug. 2018, 13:11: > The run results: > Object call Time Taken Seconds: 2.1899964194744825E-001 > Interface call Time Taken Seconds: 2.799001622200E-001 > > so, the time difference is about 27% > > > My question is, where is this extra time spent? > > I am assuming a

Re: [fpc-pascal] Link with GCC object files

2018-08-22 Thread Sven Barth via fpc-pascal
Andreas schrieb am Mi., 22. Aug. 2018, 12:59: > Hi, I have a question. Is it possible to link FPC for Linux (PC and ARM) > with GCC or other C++ object files? > You can use the $L directive for this ( https://freepascal.org/docs-html/current/prog/progsu43.html#x50-490001.2.43 ). If you use C++ i

Re: [fpc-pascal] Very slow startup of Frepascal programs on just one system

2018-08-22 Thread Sven Barth via fpc-pascal
James schrieb am Mi., 22. Aug. 2018, 11:06: > Any ideas on what may be going on? This is pretty much un-usable with > these huge delays every time I need to start one of my freepascal > programs. > As a test try to disable your anti virus and/or Windows Defender. Regards, Sven > _

Re: [fpc-pascal] why can't we define class operator for old fashion object type, but ok for 'advanced record' type?

2018-08-19 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Sa., 18. Aug. 2018, 19:38: > > > > On Aug 17, 2018, at 7:19 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > However for classes there is the problem of temporary variables. Take a > := b + c + d. That i

Re: [fpc-pascal] why can't we define class operator for old fashion object type, but ok for 'advanced record' type?

2018-08-17 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Fr., 17. Aug. 2018, 18:22: > > > > On Aug 16, 2018, at 8:55 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > It shouldn't be hard. Feel free to provide a patch together with some > tests and it will

Re: [fpc-pascal] why can't we define class operator for old fashion object type, but ok for 'advanced record' type?

2018-08-16 Thread Sven Barth via fpc-pascal
Am 16.08.2018 um 12:23 schrieb Dennis Poon: Sven Barth via fpc-pascal wrote: Am 15.08.2018 um 10:59 schrieb Dennis: Why class operator is accepted for advanced records but not old fashion object??? Because objects are not records. Internally they are handled more closely to classes than

Re: [fpc-pascal] why can't we define class operator for old fashion object type, but ok for 'advanced record' type?

2018-08-16 Thread Sven Barth via fpc-pascal
Am 16.08.2018 um 12:47 schrieb Michael Van Canneyt: Am 15.08.2018 um 17:29 schrieb Michael Van Canneyt: On Wed, 15 Aug 2018, Sven Barth via fpc-pascal wrote: But maybe you are using mode delphi ? If so, try separating out the object definition in a separate unit which is not compiled in

Re: [fpc-pascal] why can't we define class operator for old fashion object type, but ok for 'advanced record' type?

2018-08-16 Thread Sven Barth via fpc-pascal
Am 15.08.2018 um 17:29 schrieb Michael Van Canneyt: On Wed, 15 Aug 2018, Sven Barth via fpc-pascal wrote: But maybe you are using mode delphi ? If so, try separating out the object definition in a separate unit which is not compiled in delphi mode. A global operator won't help at a

Re: [fpc-pascal] why can't we define class operator for old fashion object type, but ok for 'advanced record' type?

2018-08-15 Thread Sven Barth via fpc-pascal
Am 15.08.2018 um 10:59 schrieb Dennis: Why class operator is accepted for advanced records but not old fashion object??? Because objects are not records. Internally they are handled more closely to classes than records. Regards, Sven ___ fpc-pascal m

Re: [fpc-pascal] why can't we define class operator for old fashion object type, but ok for 'advanced record' type?

2018-08-15 Thread Sven Barth via fpc-pascal
Am 15.08.2018 um 11:17 schrieb Michael Van Canneyt: On Wed, 15 Aug 2018, Dennis wrote: Michael Van Canneyt wrote: On Wed, 15 Aug 2018, Dennis wrote: I was trying to use a generic class TDictionary  with type T. This class has a method that compares a variable of T with another one.

Re: [fpc-pascal] Rebuilding RTL

2018-08-08 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 8. Aug. 2018, 18:48: > Btw, what are all these messages I get when building the compiler? I don’t > know if they should be ignored or I caused them myself. > > objc1.inc(360,3) Note: tgobj: (FreeTemp) freeing of temp at pos > -2147483648 requested > They are due to th

Re: [fpc-pascal] Rebuilding RTL

2018-08-07 Thread Sven Barth via fpc-pascal
Am 08.08.2018 um 00:42 schrieb Ryan Joseph: On Aug 7, 2018, at 4:17 PM, Sven Barth via fpc-pascal wrote: Are you sure that you used the correct compiler? Try to pass -n to tell it to ignore the fpc.cfg and see whether it picks up the correct ones when you pass them with - Fu (-Fo is not

Re: [fpc-pascal] Rebuilding RTL

2018-08-07 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 8. Aug. 2018, 00:02: > If I cd to the rtl directory in the fpc sources and run make they are > compiled into the /rtl/units/x86_64-darwin directory. > > 1) How do I compile the ppc386 units? the readme says there’s a FPC > variable for on the makefile configs but I can

Re: [fpc-pascal] Operator overload bug

2018-08-04 Thread Sven Barth via fpc-pascal
On 04.08.2018 17:31, Ben Grasset wrote: > On Sat, Aug 4, 2018 at 10:38 AM, Sven Barth via fpc-pascal > <mailto:fpc-pascal@lists.freepascal.org>> wrote: > > On 28.07.2018 16:38, John Doe wrote: > > On Mon, Jul 23, 2018 at 1:49 PM, Sven Barth via fpc-pascal

Re: [fpc-pascal] Operator overload bug

2018-08-04 Thread Sven Barth via fpc-pascal
On 28.07.2018 16:38, John Doe wrote: > On Mon, Jul 23, 2018 at 1:49 PM, Sven Barth via fpc-pascal > <mailto:fpc-pascal@lists.freepascal.org>> wrote: > > Ryan Joseph <mailto:r...@thealchemistguild.com>> schrieb am Mo., 23. Juli 2018, > 17:35: > &

Re: [fpc-pascal] access violation?

2018-07-31 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Di., 31. Juli 2018, 18:15: > > > > On Jul 30, 2018, at 11:08 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > If the method doesn't access Self then there is nothing you can do. > > Is this someth

Re: [fpc-pascal] access violation?

2018-07-30 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mo., 30. Juli 2018, 18:05: > > > > On Jul 28, 2018, at 2:03 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > The method you provided below would not fail anyway, because it doesn't > dereference Se

Re: [fpc-pascal] access violation?

2018-07-28 Thread Sven Barth via fpc-pascal
Am 27.07.2018 um 19:41 schrieb Ryan Joseph: On Jul 27, 2018, at 11:24 AM, Mattias Gaertner wrote: You can't if you compile with -CR. The RTL is not compiled with objectchecks, so it works there. According to this test not only can you call methods on nil objects but it calls the method sta

Re: [fpc-pascal] Syntax changes suggestions

2018-07-27 Thread Sven Barth via fpc-pascal
R0b0t1 schrieb am Do., 26. Juli 2018, 09:53: > On Mon, Jul 23, 2018 at 11:11 AM, Ryan Joseph > wrote: > > > > > >> On Jul 22, 2018, at 4:54 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > >> > >> And that's

Re: [fpc-pascal] Generics - extending TFPGObjectList

2018-07-26 Thread Sven Barth via fpc-pascal
Vojtěch Čihák schrieb am Do., 26. Juli 2018, 13:40: > Thanks for reply. > > > > Ad 2) I opened issue: https://bugs.freepascal.org/view.php?id=34037 > > > > Ad 1) Are there any plans for improvement of generic inheritance? Related > to my example, instead of > > > > generic TFPGObjectListEx =

Re: [fpc-pascal] Generics - extending TFPGObjectList

2018-07-25 Thread Sven Barth via fpc-pascal
Am 26.07.2018 um 02:31 schrieb Vojtěch Čihák: Hello, I needed to extend TFPGObjectList and I found two wierd things (FPC 3.1.1 r39507): program project1; {$mode objfpc}{$H+} uses   Classes, FGL; type   TBaseClass = class (TObject)   end;   TIDClass = class (TBaseClass)     ID: Intege

Re: [fpc-pascal] How __FPC_specific_handler() is invoked

2018-07-25 Thread Sven Barth via fpc-pascal
Matias Vara schrieb am Mi., 25. Juli 2018, 12:55: > > El mar., 24 jul. 2018 a las 13:57, Sven Barth via fpc-pascal (< > fpc-pascal@lists.freepascal.org>) escribió: > >> Matias Vara schrieb am Di., 24. Juli 2018, 11:04: >> >>> Hello, >>> >&g

Re: [fpc-pascal] How __FPC_specific_handler() is invoked

2018-07-24 Thread Sven Barth via fpc-pascal
Matias Vara schrieb am Di., 24. Juli 2018, 11:04: > Hello, > > I am writing my own __FPC_specific_handler() but I can't figure out when > this function is registered. I guess this function is registered to the OS > to be invoked when an exception happens. In the assembler code I have > something

Re: [fpc-pascal] Operator overload bug

2018-07-23 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mo., 23. Juli 2018, 17:35: > > > > On Jul 23, 2018, at 12:00 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Yes, it's a bug, so please report it. > > Thanks, reported. The severity is “minor”

Re: [fpc-pascal] No type info available for this type (Enumerated type with constant assignment)

2018-07-23 Thread Sven Barth via fpc-pascal
Martok schrieb am Mo., 23. Juli 2018, 17:15: > Am 23.07.2018 um 17:05 schrieb Sven Barth via fpc-pascal: > > Is this kind of enumerated type with constant assignment not > supported > > by FPC 3.0.4? > > > >TMonthType = (January=1, February, May=

Re: [fpc-pascal] No type info available for this type (Enumerated type with constant assignment)

2018-07-23 Thread Sven Barth via fpc-pascal
Dennis schrieb am Mo., 23. Juli 2018, 12:24: > Is this kind of enumerated type with constant assignment not supported > by FPC 3.0.4? > >TMonthType = (January=1, February, May=5,June, July); > The enumeration type itself is supported, however TypeInfo() and thus GetEnumName() and friends are

Re: [fpc-pascal] Syntax changes suggestions

2018-07-22 Thread Sven Barth via fpc-pascal
Am 21.07.2018 um 22:43 schrieb Ben Grasset: On Fri, Jul 20, 2018 at 1:20 AM, Sven Barth via fpc-pascal <mailto:fpc-pascal@lists.freepascal.org>> wrote: Because a feature might change the language in a way that's not in the spirit of the language. Look at how Delp

Re: [fpc-pascal] Operator overload bug

2018-07-22 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am So., 22. Juli 2018, 18:11: > I mentioned this as an aside a while ago but I don’t remember getting a > response so I’d like to formally reintroduce the issue. > > Should I file a bug report for this or is it expected behavior? Personally > I’d really like to get implicit ar

Re: [fpc-pascal] Syntax changes suggestions

2018-07-19 Thread Sven Barth via fpc-pascal
Am 20.07.2018 um 00:53 schrieb Ben Grasset: If a feature works as intended and is useful (which is all that matters), how is it "blind copying"? Because a feature might change the language in a way that's not in the spirit of the language. Look at how Delphi implemented attributes: they're decl

Re: [fpc-pascal] Pascal units to connect to an Exchange server

2018-07-19 Thread Sven Barth via fpc-pascal
luciano de souza schrieb am Do., 19. Juli 2018, 20:29: > Hello all, > From a Linux machine connected to a Windows machine by VPN, I’d like > to send e-mails programmatically using a Microsoft Exchange account. > Using Windows resources, I could call Outlook automation API to do > this task. But i

Re: [fpc-pascal] Pascal units to connect to an Exchange server

2018-07-19 Thread Sven Barth via fpc-pascal
Bo Berglund schrieb am Do., 19. Juli 2018, 21:52: > On Thu, 19 Jul 2018 15:29:12 -0300, luciano de souza > wrote: > > >Hello all, > >From a Linux machine connected to a Windows machine by VPN, I’d like > >to send e-mails programmatically using a Microsoft Exchange account. > >Using Windows resou

Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Sven Barth via fpc-pascal
R0b0t1 schrieb am Mi., 18. Juli 2018, 21:46: > On Wed, Jul 18, 2018 at 2:04 PM, Ryan Joseph > wrote: > > > > > >> On Jul 18, 2018, at 12:44 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > >> > >> And to give you a

Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 18. Juli 2018, 21:41: > > > > On Jul 18, 2018, at 12:47 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > A point against stack based classes is that Object Pascal's object model > is highly gear

Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 18. Juli 2018, 21:37: > > > > On Jul 18, 2018, at 12:44 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > And to give you a slightly different example: around a year ago or so I > implemented a IfThe

Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 18. Juli 2018, 19:00: > > > > On Jul 18, 2018, at 7:14 AM, Ben Grasset wrote: > > > > Classes are unsuitable performance-wise for many use cases, and TP > objects lack important features such as variant parts. Advanced records are > a great lightweight in-between poin

Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 18. Juli 2018, 19:15: > > > > On Jul 17, 2018, at 2:41 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > There is a more important difference: the developers and the users. Only > because the latte

Re: [fpc-pascal] How to translate Delphi Assembly MOV EAX,[EBP+4]

2018-07-18 Thread Sven Barth via fpc-pascal
Dennis schrieb am Mi., 18. Juli 2018, 19:01: > Thanks. > > So the following will give an address+frame of the calling routine ? > get_caller_addr(get_frame), get_caller_frame(get_frame) > As long as you pass it to the "raise ... at", yes. Regards, Sven > _

Re: [fpc-pascal] How to translate Delphi Assembly MOV EAX,[EBP+4]

2018-07-18 Thread Sven Barth via fpc-pascal
Dennis schrieb am Mi., 18. Juli 2018, 17:19: > The following delphi code when compiled by FPC, raised these errors: > Compile Project, Target: lib\x86_64-win64\Project1.exe: Exit code 1, > Errors: 10, Warnings: 2 > StrBuffer.pas(100,19) Error: Unknown identifier "EAX" > StrBuffer.pas(100,23) Erro

Re: [fpc-pascal] Syntax changes suggestions

2018-07-17 Thread Sven Barth via fpc-pascal
Am 17.07.2018 um 22:32 schrieb Ryan Joseph: On Jul 17, 2018, at 2:15 PM, Sven Barth via fpc-pascal wrote: Those specific features you mention were added because of Delphi compatibility not because someone thought they are good. Florian even likened records with methods to a can of worms

Re: [fpc-pascal] Syntax changes suggestions

2018-07-17 Thread Sven Barth via fpc-pascal
Am 17.07.2018 um 20:00 schrieb Ryan Joseph: On Jul 17, 2018, at 11:27 AM, Jim Lee wrote: Likewise, "modern" programming languages are all converging on a common feature set, like cultural cross-pollination. if that’s our mindset then how do we account for times when we’ve actually identifi

Re: [fpc-pascal] Syntax changes suggestions

2018-07-17 Thread Sven Barth via fpc-pascal
Marco van de Voort schrieb am Di., 17. Juli 2018, 16:50: > To be honest, I'm wondering why Sven actually bothers to answer this > nonsense. > Trust me, I wonder the same 🙄 Regards, Sven > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org ht

Re: [fpc-pascal] Syntax changes suggestions

2018-07-17 Thread Sven Barth via fpc-pascal
Henry Vermaak schrieb am Di., 17. Juli 2018, 11:05: > On Mon, Jul 16, 2018 at 03:02:42PM +0200, Sven Barth via fpc-pascal wrote: > > Santiago A. schrieb am Mo., 16. Juli 2018, 13:41: > > > > > I have some suggestions of change to freepascal syntax, just to debate >

Re: [fpc-pascal] Syntax changes suggestions

2018-07-16 Thread Sven Barth via fpc-pascal
Am 17.07.2018 um 04:48 schrieb Ryan Joseph: On Jul 16, 2018, at 7:02 AM, Sven Barth via fpc-pascal wrote: Might come, though not in that way (take your example: what if you pass the instance to some other code that stores it beyond the life time of the function) That’s what you guys said

Re: [fpc-pascal] Syntax changes suggestions

2018-07-16 Thread Sven Barth via fpc-pascal
Am 16.07.2018 um 23:14 schrieb R0b0t1: On Mon, Jul 16, 2018 at 3:28 PM, Sven Barth via fpc-pascal wrote: Am 16.07.2018 um 19:55 schrieb R0b0t1: - Try except finally blocks I can support this one, I am surprised it is not already supported. Wasn't this mentioned in another recent thre

Re: [fpc-pascal] Syntax changes suggestions

2018-07-16 Thread Sven Barth via fpc-pascal
Am 16.07.2018 um 19:55 schrieb R0b0t1: - Try except finally blocks I can support this one, I am surprised it is not already supported. Wasn't this mentioned in another recent thread as existing? Does it exist in at least Delphi mode? This is not supported and the last time it was discussed h

Re: [fpc-pascal] Syntax changes suggestions

2018-07-16 Thread Sven Barth via fpc-pascal
Santiago A. schrieb am Mo., 16. Juli 2018, 16:27: > El 16/07/2018 a las 15:02, Sven Barth via fpc-pascal escribió: > > Santiago A. schrieb am Mo., 16. Juli 2018, 13:41: > >> I have some suggestions of change to freepascal syntax, just to debate >> >>

Re: [fpc-pascal] Syntax changes suggestions

2018-07-16 Thread Sven Barth via fpc-pascal
Santiago A. schrieb am Mo., 16. Juli 2018, 13:41: > I have some suggestions of change to freepascal syntax, just to debate > > (All are backward compatible) > > - Declaring variables inside blocks, and loop variables > -> reduces readability -> no interest - Autofree pointers > Might come, thoug

Re: [fpc-pascal] Loss of precision when using math.Max()

2018-07-13 Thread Sven Barth via fpc-pascal
Martok schrieb am Fr., 13. Juli 2018, 16:37: > The other links were about intermediates of runtime calculations, so this > change > is correct: > > I have added support for the directive $EXCESSPRECISION: it forces that > all binary float operations are executed with > > the highest available pre

Re: [fpc-pascal] Embedding DLL into EXE for Windows 32 bit?

2018-07-07 Thread Sven Barth via fpc-pascal
Zoe Peterson schrieb am Sa., 7. Juli 2018, 10:04: > > 3) Codesign the DLL and executable and verify that they haven't been > modified. There's code to do that on Stack Overflow, though it wasn't > tested on Lazarus: > https://stackoverflow.com/questions/5993877/checking-digital- > signature-progr

Re: [fpc-pascal] TFPGObjectList error

2018-07-03 Thread Sven Barth via fpc-pascal
Am 01.07.2018 um 04:14 schrieb Michalis Kamburelis: 2018-07-01 4:01 GMT+02:00 Vojtěch Čihák : this seems to be misleading error message. TFPGObjectList works well for objects (classes). When I tried to push record to it, I got the same error message. TVec3 is not class, right? Indeed, it's a

Re: [fpc-pascal] Loss of precision when using math.Max()

2018-06-29 Thread Sven Barth via fpc-pascal
Am 29.06.2018 um 18:45 schrieb Alan Krause: I stumbled upon something the other day that was causing numerical differences between compiled Delphi and FPC code. Executing the following sample console application illustrates the issue clearly: program test; uses   math, SysUtils; var   arg1 :

Re: [fpc-pascal] Support for "class threadvar" sections inside class and record types

2018-06-23 Thread Sven Barth via fpc-pascal
R0b0t1 schrieb am Sa., 23. Juni 2018, 18:50: > On Saturday, June 23, 2018, Ryan Joseph > wrote: > > > > > >> On Jun 23, 2018, at 9:45 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > >> > >> See also here:

Re: [fpc-pascal] Support for "class threadvar" sections inside class and record types

2018-06-23 Thread Sven Barth via fpc-pascal
Anthony Walter schrieb am Sa., 23. Juni 2018, 22:56: > Much thanks Sven! I'm note sure when I'll use it, but the option is always > nice to have. A small question, since it's available in a class, does > "class threadvar" support generics? > > {$mode delphi} > > type > TAnimal = class > publi

Re: [fpc-pascal] Compiling 3.1.1 trunk

2018-06-23 Thread Sven Barth via fpc-pascal
Jim Lee schrieb am Sa., 23. Juni 2018, 17:34: > Hi, newbie to fpc (but not Pascal) here. > > I'm trying to compile the fpc trunk from svn on linux. I managed to > find the buildfaq, but I'm running into problems. > > I've done this: > > $ svn checkout http://svn.freepascal.org/svn/fpcbuild fpcbu

Re: [fpc-pascal] Support for "class threadvar" sections inside class and record types

2018-06-23 Thread Sven Barth via fpc-pascal
Am 23.06.2018 um 16:51 schrieb Ryan Joseph: On Jun 23, 2018, at 9:45 PM, Sven Barth via fpc-pascal wrote: See also here: https://www.freepascal.org/docs-html/ref/refse26.html I had no idea this existed. When was it added? Probably around 2.0 when Delphi support was added... 🤷‍♀️ So quite

Re: [fpc-pascal] Support for "class threadvar" sections inside class and record types

2018-06-23 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Sa., 23. Juni 2018, 16:04: > > > > On Jun 23, 2018, at 8:55 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > A threadvar section is started using "class threadvar" and the "class" >

[fpc-pascal] Support for "class threadvar" sections inside class and record types

2018-06-23 Thread Sven Barth via fpc-pascal
Hello together! Announcing a small feature this time, but some might appreciate it: FPC now supports the declaration of threadvars inside class and record types. === code begin === {$mode objfpc} {$modeswitch advancedrecords} type   TTestClass = class   public class threadvar     Test: LongI

Re: [fpc-pascal] Proper preprocessor?

2018-06-22 Thread Sven Barth via fpc-pascal
Am 22.06.2018 um 23:10 schrieb Marcos Douglas B. Santos: On Fri, Jun 22, 2018 at 5:13 PM, Florian Klämpfl wrote: {$macro on} {$define TypeStr:=specialize _TypeStr} begin Writeln(TypeStr); end. Can I use the same idea but for units? Like this: {$macro on} uses {$ifdef debug} foo

Re: [fpc-pascal] Proper preprocessor?

2018-06-22 Thread Sven Barth via fpc-pascal
Am 22.06.2018 um 22:13 schrieb Florian Klämpfl: Am 22.06.2018 um 22:07 schrieb Sven Barth via fpc-pascal: Am 22.06.2018 um 10:12 schrieb Ryan Joseph: On Jun 22, 2018, at 12:24 PM, Sven Barth via fpc-pascal wrote: If $Assertions is set to Off the complete Assert() line will be absent from

Re: [fpc-pascal] Default record fields

2018-06-22 Thread Sven Barth via fpc-pascal
Am 22.06.2018 um 16:18 schrieb Ryan Joseph: On Jun 22, 2018, at 6:19 PM, Karoly Balogh (Charlie/SGR) wrote: Because C# and Shift are managed languages, and C++ just includes everything for no good reason. And this is actually major, with far fetching implications. C++ is an utter mess for th

Re: [fpc-pascal] Default record fields

2018-06-22 Thread Sven Barth via fpc-pascal
Am 22.06.2018 um 17:08 schrieb Anthony Walter: Sven says dynamic packages are coming, but a few independent things need to be completed. Sven, do you care to add anything? It's mainly low level code generation and integration with the RTL, so I doubt that there is much that can be helped there.

Re: [fpc-pascal] Proper preprocessor?

2018-06-22 Thread Sven Barth via fpc-pascal
Am 22.06.2018 um 10:12 schrieb Ryan Joseph: On Jun 22, 2018, at 12:24 PM, Sven Barth via fpc-pascal wrote: If $Assertions is set to Off the complete Assert() line will be absent from the compiled code. Good to know thanks. Here’s an example of something I’ve seen for debugging. I think

Re: [fpc-pascal] Proper preprocessor?

2018-06-22 Thread Sven Barth via fpc-pascal
Michael Van Canneyt schrieb am Fr., 22. Juni 2018, 08:01: > > > On Fri, 22 Jun 2018, Ryan Joseph wrote: > > > > > > >> On Jun 22, 2018, at 12:21 PM, Michael Van Canneyt < > mich...@freepascal.org> wrote: > >> > >> 'Nice' is not an argument. > >> > >> If someone else assumes that assert() works as

Re: [fpc-pascal] Proper preprocessor?

2018-06-22 Thread Sven Barth via fpc-pascal
denisgolovan schrieb am Fr., 22. Juni 2018, 10:24: > Generics are rather limited in that respect. > At least some construction should exist to instantiate those generics. > e.g. to create several public structs, interfaces, free functions > (possibly instancing generics) in one go. > Do you have

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Sven Barth via fpc-pascal
Am 22.06.2018 um 06:35 schrieb Ryan Joseph: Here’s a macro I like from C. It captures the assert expression and prints it back out into the console (it would halt the program also). Can this be done in Pascal? In C they return the file name and line number also which is really nice. {$define

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Sven Barth via fpc-pascal
Am 21.06.2018 um 17:25 schrieb Ryan Joseph: On Jun 21, 2018, at 10:08 PM, Sven Barth via fpc-pascal wrote: For more questions you can start a thread in fpc-devel. That's the purpose of that mailing list after all. Thanks, I’ll post there tomorrow about the technical stuff. At

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 21. Juni 2018, 15:53: > I’m actually making rapid progress on a macro function syntax where the > parameters are replaced by the inputs when called: > > {$define put(x):='into_x’} > > put(100); // replaces to ‘into_100’ > > Do I have permission to develop this feature

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Sven Barth via fpc-pascal
Mattias Gaertner schrieb am Do., 21. Juni 2018, 09:24: > On Wed, 20 Jun 2018 21:56:56 +0200 > Sven Barth via fpc-pascal wrote: > > >[...] > > The modeswitch is enabled by default in Delphi modes as this feature was > > added for Delphi compatibility. > > I

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Sven Barth via fpc-pascal
Mark Morgan Lloyd schrieb am Do., 21. Juni 2018, 09:11: > On 20/06/18 20:00, Sven Barth via fpc-pascal wrote: > > > Addendum: the support for the "+" operator is now coupled to a new > > modeswitch "ArrayOperators". > > If the modeswitch is enab

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 21. Juni 2018, 08:37: > > > > On Jun 21, 2018, at 1:21 PM, Ryan Joseph > wrote: > > > > Thanks Sven. So it was the Lazarus step I was missing! I know about > using “lazbuild” from the command line but there are many .lpi projects in > /compiler. Which one is ppc386? I

<    3   4   5   6   7   8   9   10   11   12   >