Re: [fpc-pascal] Concatenating CP Strings

2018-09-14 Thread Mattias Gaertner via fpc-pascal
On Sat, 15 Sep 2018 01:38:33 +0200 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 codep

[fpc-pascal] INSTALL_PREFIX, INSTALL_LIBDIR

2018-10-18 Thread Mattias Gaertner via fpc-pascal
Hi, How to control where 'make install' puts the libraries (e.g. libpas2js.so)? I tried "INSTALL_LIBDIR=~/tmp/lib64", but that moves everything *except* libraries to "~/tmp/lib64". See bug https://bugs.freepascal.org/view.php?id=34346 Mattias ___ fpc

Re: [fpc-pascal] INSTALL_PREFIX, INSTALL_LIBDIR

2018-11-11 Thread Mattias Gaertner via fpc-pascal
On Fri, 19 Oct 2018 16:40:19 +0200 christo wrote: > On 2018/10/18 09:26, Mattias Gaertner via fpc-pascal wrote: > > How to control where 'make install' puts the libraries (e.g. > > libpas2js.so)? > > > > I tried "INSTALL_LIBDIR=~/tmp/lib64", but

Re: [fpc-pascal] Constants in generics

2018-11-27 Thread Mattias Gaertner via fpc-pascal
On Tue, 27 Nov 2018 11:35:22 +0100 Sven Barth via fpc-pascal wrote: >[...] > > const > > kSomeDays:TDays = [Mon, Wed]; >[...] > The difference between typed and untyped constants are available > everywhere else in the language as well, so I have no qualms (at > least for now?) to error ou

[fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
Hi, According to the docs, the "is" operator is fourth level, the "and" is second level, so the "and" must be computed before the "is". But it seems fpc treats "is" and "and" as same level: {$mode objfpc} uses Classes; var b: boolean; o: TObject; begin // this compiles, but should fail: i

Re: [fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
On Sat, 8 Dec 2018 20:38:23 +0100 Mattias Gaertner via fpc-pascal wrote: >[...] > According to the docs, the "is" operator is fourth level, the "and" is > second level, so the "and" must be computed before the "is". But it > seems fpc treats &

Re: [fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
On Sat, 8 Dec 2018 20:38:23 +0100 Mattias Gaertner via fpc-pascal wrote: > Hi, > > According to the docs, the "is" operator is fourth level, the "and" is > second level, so the "and" must be computed before the "is". Link: https://ww

Re: [fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
On Sat, 8 Dec 2018 21:23:57 +0100 Marco van de Voort wrote: > Op 2018-12-08 om 20:38 schreef Mattias Gaertner via fpc-pascal: > > According to the docs, the "is" operator is fourth level, the "and" > > is second level, so the "and" must be computed

Re: [fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
On Sat, 8 Dec 2018 22:03:11 +0100 (CET) Michael Van Canneyt wrote: >[...] > In delphi, AS is second level, and 'is' is fourth level. > > http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Expressions_(Delphi) > > If FPC does this differently, then I think this is an incompatibility. What has "a

Re: [fpc-pascal] Generic (TFPGObjectList) EInvalidCast

2018-12-11 Thread Mattias Gaertner via fpc-pascal
On Tue, 11 Dec 2018 22:19:11 +0100 Vojtěch Čihák wrote: > Hi, >   > why this code gives EInvalidCast at runtime (but compiles well):w >   > program Project1; > {$mode objfpc}{$H+} >   > uses >   {$IFDEF UNIX}{$IFDEF UseCThreads} >   cthreads, >   {$ENDIF}{$ENDIF} >   Classes, fgl >   { you can ad

Re: [fpc-pascal] Constants in generics

2019-01-03 Thread Mattias Gaertner via fpc-pascal
On Thu, 3 Jan 2019 14:58:00 +0300 Alexander Shishkin via fpc-pascal wrote: >[...] > This is OK (both T and U are integer): > generic TMyRecord1 = record end; That is inconsistent to normal Pascal arguments. Name[, Name ...][:type] Isn't it? Mattias ___

Re: [fpc-pascal] Multi-scope helpers draft

2019-01-10 Thread Mattias Gaertner via fpc-pascal
On Sat, 24 Nov 2018 11:20:05 +0700 Ryan Joseph wrote: > I’d like to propose this mode switch ($modeswitch multiscopehelpers) > to allow multiple helpers per scope. Can you explain the order/precedence of multiple helpers? Btw, why is the modeswitch called multiscopehelpers instead of multihelpe

[fpc-pascal] type helpers

2019-01-11 Thread Mattias Gaertner via fpc-pascal
Hi, A type helper can change Self. I wondered how FPC 3.3.1 handles properties and got some unexpected results. Is this by design, a bug, or not-yet-implemented? {$mode objfpc}{$modeswitch typehelpers} type TIntHlp = type helper for word procedure DoIt; end; TBig = class strict priva

Re: [fpc-pascal] type helpers

2019-01-11 Thread Mattias Gaertner via fpc-pascal
On Fri, 11 Jan 2019 14:27:13 +0100 Sven Barth via fpc-pascal wrote: >[...] > This is by design. In this case DoIt is called on a temp variable > that gets its value from b.w, the value of b.FW does not change Ehm, in this case b.FW *does* changes. Maybe you mean the case property W: word read

[fpc-pascal] type helper constructor

2019-01-17 Thread Mattias Gaertner via fpc-pascal
Hi, A type helper for a string can add a constructor. But how it can be used differs between FPC and Delphi. For example: {$modeswitch typehelpers} type THelper = type helper for string constructor Creator(i: integer); end; var s: string; begin string.creator(3); // allowed in d

[fpc-pascal] type helper default property

2019-01-17 Thread Mattias Gaertner via fpc-pascal
Hi, For example: type THelper = type helper for string function GetItems(Index: word): word; property Items[Index: word]: word read GetItems; default; end; Delphi forbids this with "'default' directive not allowed in record helper type". FPC ignores it. Aka aString[1] has still the no

Re: [fpc-pascal] type helper default property

2019-01-17 Thread Mattias Gaertner via fpc-pascal
On Thu, 17 Jan 2019 22:42:39 +0100 Sven Barth via fpc-pascal wrote: >[...] > > Is this an oversight, or has FPC some use for the default > > directive? > For now I'd say that it's an oversight. Delphi allows it for class > and record helpers, but not for helpers for primitive types. In > theory

[fpc-pascal] Lazarus Release 2.0.0

2019-02-05 Thread Mattias Gaertner via fpc-pascal
The Lazarus team is glad to announce the release of Lazarus 2.0.0. This release was built with FPC 3.0.4. The previous release Lazarus 1.8.4 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes h

Re: [fpc-pascal] FPC fixes3.2 gives error on "NWord div 2 * 2"

2019-02-17 Thread Mattias Gaertner via fpc-pascal
FPC gives an error on the NWord Maybe the compiler tries to be politically correct. 😂 Sorry, couldn't resist. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Class helper properties

2019-02-25 Thread Mattias Gaertner via fpc-pascal
On Sun, 24 Feb 2019 11:03:17 -0500 Ryan Joseph wrote: > http://wiki.freepascal.org/Helper_types#Usage says class helpers can > use properties. Why am I getting this error? > > program test; > > type > TMyObject = class > m_num: integer; > property num1: integer

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Mattias Gaertner via fpc-pascal
On Mon, 25 Feb 2019 11:44:35 -0500 Ryan Joseph wrote: > Update on multi-scope helpers. I’ve added tests (tmshlp*.pp), fixed a > bug and renamed the mode switch to “multihelpers” which I think is > more concise than “multiscopehelpers” and fits the format with > “typehelpers”. Thanks! Good that

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Mattias Gaertner via fpc-pascal
On Mon, 25 Feb 2019 12:49:16 -0500 Ryan Joseph wrote: > > On Feb 25, 2019, at 12:41 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > At least FPC helpers are more consistent than Delphi. > > inherited crap > > I’m pretty confident I didn’t add any

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Mattias Gaertner via fpc-pascal
On Mon, 25 Feb 2019 12:20:13 -0500 Ryan Joseph wrote: > Question, is this mode switch allowed in Delphi mode? I disabled it > because I had a comment that said it was ObjFPC mode only but that > doesn’t make sense it couldn’t be enabled manually even in Delphi > mode. Since $modeswitch typehelpe

Re: [fpc-pascal] *.rst vs *.rsj

2019-03-06 Thread Mattias Gaertner via fpc-pascal
On Wed, 6 Mar 2019 21:09:26 + Graeme Geldenhuys wrote: > Hi, > > Somewhere after FPC 2.6.4 the FPC compiler changed to generating JSON > based *.rsj files for resource strings. > > 1. What was the benefit of doing that? AFAIR multilines: http://lists.lazarus.freepascal.org/pipermail/lazar

[fpc-pascal] bug in make install ?

2019-03-15 Thread Mattias Gaertner via fpc-pascal
Hi, How to install fpc 3.3.1? When I use make install under Linux, Lazarus complains: Error: the Fppkg configuration is corrupt. I can compile everything without errors. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.

Re: [fpc-pascal] bug in make install ?

2019-03-18 Thread Mattias Gaertner via fpc-pascal
On Mon, 18 Mar 2019 17:02:35 +0100 Joost van der Sluis wrote: > Op 15-03-19 om 22:48 schreef Mattias Gaertner via fpc-pascal: > > How to install fpc 3.3.1? > > > > When I use make install under Linux, Lazarus complains: > > Error: the Fppkg configuration is corr

Re: [fpc-pascal] bug in make install ?

2019-03-18 Thread Mattias Gaertner via fpc-pascal
On Mon, 18 Mar 2019 22:04:17 +0100 Joost van der Sluis wrote: >[...] > > If fppkg.cfg is the cause, why does the Lazarus initial setup not > > tell this? > > I found it difficult to come up with a descriptive message. > > Do you think that "fppkg.cfg" is better then "fppkg configuration"? D

Re: [fpc-pascal] bug in make install ?

2019-03-19 Thread Mattias Gaertner via fpc-pascal
On Tue, 19 Mar 2019 11:17:42 +0100 Joost van der Sluis wrote: >[...] > > Probably it fails because I have old 2.6.4 fppkg configs. I ran the samplecfg, which said it would create ~/.fpc.cfg, ~/.fp, ... Then the error was gone. I restored the files from backup. Initial dialog pops up with erro

Re: [fpc-pascal] strict private construct

2019-04-12 Thread Mattias Gaertner via fpc-pascal
On Fri, 12 Apr 2019 12:23:15 +0100 Graeme Geldenhuys wrote: > Hi, > > What exactly is the point of "strict private"? I believe FPC supports > it too, after Delphi added it. It makes absolutely no senses to me. > From the name and original intent, it means it is "really really > private" even in

[fpc-pascal] Lazarus Release 2.0.2

2019-04-16 Thread Mattias Gaertner via fpc-pascal
The Lazarus team is glad to announce the release of Lazarus 2.0.2. This release was built with FPC 3.0.4. The previous release Lazarus 2.0.0 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes h

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Mattias Gaertner via fpc-pascal
On Tue, 16 Apr 2019 11:37:56 -0700 Ralf Quint wrote: >[...] > Anyone who seriously develops software, specially desktop > applications, is/should be using at least two (better 3 monitors). > And the "many" different windows allow easily to spread those out to > those various screens as needed. On

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Mattias Gaertner via fpc-pascal
On Tue, 16 Apr 2019 21:02:50 +0200 Rainer Stratmann wrote: > On Dienstag, 16. April 2019 14:34:05 CEST Sven Barth via fpc-pascal > wrote: > > You can install the AnchorDockingDsgn package and have all windows > > integrated (except for forms which need an additional package). > > That sounds g

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Mattias Gaertner via fpc-pascal
On Tue, 16 Apr 2019 21:13:52 +0200 Rainer Stratmann wrote: > On Dienstag, 16. April 2019 21:02:50 CEST Rainer Stratmann wrote: > > But how can I install/activate it. > > I found an instruction, but I got an error: > > lazarus.pp(1,1) Fatal: Kann anchordockingdsgn nicht finden verwendet > von

Re: [fpc-pascal] Record helper properties

2019-04-24 Thread Mattias Gaertner via fpc-pascal
On Wed, 24 Apr 2019 17:16:05 +0200 Sven Barth via fpc-pascal wrote: > Am 24.04.2019 um 15:28 schrieb Ryan Joseph: > > > >> On Apr 24, 2019, at 2:27 AM, Michael Van Canneyt > >> wrote: > >> > >> I would think this should be allowed, yes. I see no reason to > >> disallow it. > > Agreed but Sve

Re: [fpc-pascal] Feature Announcement: Support for multiple active helpers per type

2019-05-10 Thread Mattias Gaertner via fpc-pascal
On Fri, 10 May 2019 21:56:56 +0200 Sven Barth via fpc-pascal wrote: >[...] > We are pleased to announce that Free Pascal now supports the usage of > multiple active helper types per extended type. This feature has been > developed by Ryan Joseph, so thank you very much Ryan. Thanks Ryan! >[

Re: [fpc-pascal] Checking if a TStringList already exists

2019-05-21 Thread Mattias Gaertner via fpc-pascal
On Tue, 21 May 2019 16:47:28 +0100 Graeme Geldenhuys wrote: >[...] > I fully agree with what Michael said. You can't truly expect > applications developer to trail and error what needs to be done. It's > an LCL issue that the Lazarus project needs to fix. Delphi's VCL, > fpGUI Toolkit and MSEide+

Re: [fpc-pascal] wiki.freepascal.org is down?

2019-06-10 Thread Mattias Gaertner via fpc-pascal
On Wed, 5 Jun 2019 16:44:14 +0200 (CEST) "Karoly Balogh (Charlie/SGR)" wrote: > Hi, > > On Wed, 5 Jun 2019, Dmitry Boyarintsev wrote: > > > It's in maintenance mode now.You can actually open a sub page. > > I.e.: http://wiki.freepascal.org/Lazarus_Faq > > > > Yet the main page seems to be affec

Re: [fpc-pascal] wiki and mailing lists are moved

2019-06-12 Thread Mattias Gaertner via fpc-pascal
On Wed, 12 Jun 2019 00:50:22 +0200 (CEST) "Karoly Balogh (Charlie/SGR)" wrote: > Hi, > > So after the too long period of the wiki and mailing lists in limbo, > and facing danger of data corruption/los they've been moved to a > brand new cloud hosted server. Thank You! > Additionally, HTTPS h

[fpc-pascal] Lazarus Release 2.0.4

2019-08-06 Thread Mattias Gaertner via fpc-pascal
The Lazarus team is glad to announce the release of Lazarus 2.0.4. This release was built with FPC 3.0.4. The previous release Lazarus 2.0.2 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes h

Re: [fpc-pascal] Illegal counter variable?

2019-09-09 Thread Mattias Gaertner via fpc-pascal
On Mon, 9 Sep 2019 11:44:05 +0200 SPRL AFOR wrote: > Hi. > > Index variable can neither be initialized nor computed. Read > https://wiki.lazarus.freepascal.org/FOR..DO That page only talks about assigning the loop var *inside* the loop, which is forbidden. James question is about the differen

Re: [fpc-pascal] Illegal counter variable?

2019-09-09 Thread Mattias Gaertner via fpc-pascal
On Mon, 9 Sep 2019 19:27:49 +0200 Bart wrote: > On Mon, Sep 9, 2019 at 4:54 PM Jonas Maebe > wrote: > > > "var i : longint = 0;" is internally handled using the same code > > path as "const i : longint = 0", and typed constants cannot be used > > as counter variables. This is indeed probably a

Re: [fpc-pascal] It's alive !

2019-09-21 Thread Mattias Gaertner via fpc-pascal
On Sat, 21 Sep 2019 15:22:54 +0200 (CEST) Michael Van Canneyt wrote: >[...] > The first result can be seen here: > > https://www.freepascal.org/~michael/lyff/ > > Conway's game of life written using FPC: > > - FPC itself for the WebAssembly Backend library. > - pas2js for the necessary Javascr

Re: [fpc-pascal] [Pas2js] It's alive !

2019-09-29 Thread Mattias Gaertner via fpc-pascal
On Sun, 29 Sep 2019 08:01:18 +0200 (CEST) Michael Van Canneyt wrote: > On Sun, 29 Sep 2019, Joao Schuler wrote: > > > I would like to give a try to WebAssembly as a target in my own > > project ( https://github.com/joaopauloschuler/neural-api ). From > > where can I get this compiler? > > >

[fpc-pascal] generic proc inference

2019-10-03 Thread Mattias Gaertner via fpc-pascal
Hi, What is the state of FPC support for calling generic procedures using inference like Delphi? For example: {$mode objfpc} generic procedure Run(a: T); begin end; begin Run(2); end. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Fri, 4 Oct 2019 11:10:22 -0400 Ryan Joseph wrote: > > On Oct 3, 2019, at 6:07 PM, Sven Barth via fpc-pascal > > wrote: > > > > A patch for it by Ryan Joseph exists > > ( https://bugs.freepascal.org/view.php?id=35261 ), but I've not yet > > found the time to review it. > > I’m eager to use

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 12:23:57 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 12:18 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Ryan, is patch_3_25.diff the latest patch? > > > > I get a lot of merge conflicts. > > What fpc revision is nee

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 17:03:10 -0400 Ryan Joseph wrote: >[...] > > 2. > > DoThis(1,200) gives range check warning instead of error. A warning > > means there are some rare cases, where this code is correct. Is > > this a todo or do you see a useful case? > > Which test? Please post a sample. gen

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 17:10:54 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 5:03 PM, Ryan Joseph > > wrote: > >> On Oct 6, 2019, at 2:06 PM, Mattias Gaertner via fpc-pascal > >> wrote: > >> > >> 1. > >> FPC allows default params, Delph

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:19:37 -0400 Ryan Joseph wrote: >[...] > That works then. Added a test: > [...] Thanks. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:16:16 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 5:40 PM, Mattias Gaertner via fpc-pascal > > wrote: > >> Which test? Please post a sample. > > > > generic procedure DoThis(a:T; b:T); > > begin end; > > > > be

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:16:16 -0400 Ryan Joseph wrote: >[...] > >>> 3. > >>> timpfuncspez2.pp > >>> DoThis > >>> DoThis > >>> Delphi gives an error "Ambiguous call to DoThis". FPC silently > >>> selects the one with only one param. IMO this is dangerous, it > >>> should give an error. > > > >

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:16:16 -0400 Ryan Joseph wrote: >[...] > I think my logic is different from what you expect though and I’m > happy to change it if we need to. > > There’s the comment I left in the code for the > “try_implicit_specialization” function. > > { find generic procsyms by p

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 07:54:51 +0200 Sven Barth via fpc-pascal wrote: > Ryan Joseph schrieb am Mo., 7. Okt. 2019, > 00:16: >[...] > > >>> 3. > > >>> timpfuncspez2.pp > > >>> DoThis > > >>> DoThis > > >>> Delphi gives an error "Ambiguous call to DoThis". FPC silently > > >>> selects the one with on

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 14:12:32 +0200 Sven Barth via fpc-pascal wrote: >[...] > > > > > generic function DoThis(a: T): T; overload; > > > > > begin end; > > > > > generic function DoThis(a: T): U; overload; > > > > > begin end; > > > > > > > > > > begin > > > > > DoThis(3); // both fits, should give

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 14:37:16 +0200 (CEST) Michael Van Canneyt wrote: > On Mon, 7 Oct 2019, Mattias Gaertner via fpc-pascal wrote: > >[...] > I think sven means if you have e.g. 3 functions: > > generic function DoThis(a: T): T; overload; > begin end; > > gener

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 15:37:46 +0200 (CEST) Michael Van Canneyt wrote: >[...] > > You mean, if a bad overload can be nullified by a good one? That > > would be insane... > > > > Yes, Delphi eats it without warning. > > > > And it works even with a generic param: > > > > generic function Run(a: T; b:

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 09:51:47 -0400 Ryan Joseph wrote: > Right now this gives an error because you can’t add normal functions > AFTER generic functions with the same name in the same scope. I can’t > find the bug report but I think Sven fixed this recently or gave a > better error at least. I see

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 09:38:45 -0400 Ryan Joseph wrote: >[...] > > This means you don't support: > > generic procedure Run(a: T; b:S); overload; > > That’s correct, this breaks the logic entirely. This to me looks like > a sneaky way to trick the compiler and since it’s trying to infer > somethin

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 12:38:51 -0400 Ryan Joseph wrote: > > On Oct 7, 2019, at 10:19 AM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Note that in Delphi the "non-generic-wins" rule is per parameter: > > > > procedure Run(a:T; b: word); > &

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 19:47:58 +0200 Sven Barth via fpc-pascal wrote: > Mattias Gaertner via fpc-pascal > schrieb am Mo., 7. Okt. 2019, 18:42: > > > On Mon, 7 Oct 2019 12:38:51 -0400 > > Ryan Joseph wrote: > > > > > > On Oct 7, 2019, at 10:19 AM, Mattias

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 16:35:42 -0400 Ryan Joseph wrote: >[...] > procedure Run(a: integer; b: string); > begin > end; > > generic procedure Run(a: S; b: T; c: integer); > begin > end; > > > // fails because the non-generic Run() will always be picked and the > parameter count will be wrong. Run(1

Re: [fpc-pascal] fcl-passrc errors

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Mon, 14 Oct 2019 07:37:38 +0200 Sven Barth via fpc-pascal wrote: >[...] > Because the iterator returns a Pointer and not whatever you think it > might return. If you know it's something else, you cast that inside > the loop. I agree with Sven. What about the other way round? For example th

Re: [fpc-pascal] fcl-passrc method/function invocations

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Sun, 13 Oct 2019 23:13:04 +0200 (CEST) Michael Van Canneyt wrote: >[...] > The resolver is implemented in pasresolver.pp and pasresolveeval.pas > (but I think you'll only need the former) The latter is used by the former. Note that the resolver can only parse whole modules, not mere expressio

Re: [fpc-pascal] fcl-passrc errors

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Mon, 14 Oct 2019 14:02:44 +0200 Sven Barth via fpc-pascal wrote: > Mattias Gaertner via fpc-pascal > schrieb am Mo., 14. Okt. 2019, 10:39: >[...] > First you agree with me and then you provide in essence the same > examples as Ryan? So what is it now? Ryan gave several exa

Re: [fpc-pascal] DirectoryExists on FreeBSD , problem

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Mon, 14 Oct 2019 16:07:31 +0300 "Alexey Tor." wrote: >  FPC 3.3.1-r43118 [2019/10/04], on Linux x64, cross compiling to > FreeBSD x64 12.0 (TrueOS). > Smth is broken in DirectoryExistsUTF8() on FreeBSD. Does SysUtils.DirectoryExists work? > After this FPC > update CudaText cannot see tha

Re: [fpc-pascal] fcl-passrc method/function invocations

2019-10-15 Thread Mattias Gaertner via fpc-pascal
On Tue, 15 Oct 2019 16:38:35 -0400 Ryan Joseph wrote: > Another related question about functions. > > In unit files there is a InterfaceSection/ImplementationSection in > TPasModule and I can use those to get a list of functions (because > they descend from TPasSection). In a program file there

Re: [fpc-pascal] DirectoryExists on FreeBSD , problem

2019-10-26 Thread Mattias Gaertner via fpc-pascal
On Sat, 26 Oct 2019 00:45:22 +0100 Graeme Geldenhuys wrote: > On 14/10/2019 7:38 pm, Alexey Tor. wrote: > > >Does SysUtils.DirectoryExists work? > > > > No, the dir name is pure English, so DirectoryExistsUTF8 does the > > same. > > :-) There is no such thing as "pure English". He meant A

[fpc-pascal] Lazarus Release 2.0.6

2019-11-01 Thread Mattias Gaertner via fpc-pascal
The Lazarus team is glad to announce the release of Lazarus 2.0.6. This release was built with FPC 3.0.4. The previous release Lazarus 2.0.4 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes h

Re: [fpc-pascal] $modeswitch from command line

2020-02-04 Thread Mattias Gaertner via fpc-pascal
On Tue, 4 Feb 2020 08:41:22 + (UTC) Mr Bee via fpc-pascal wrote: > As mention in the email title, what I meant is {$modeswitch} not > {$mode} as explain > here: https://www.freepascal.org/docs-html/prog/progsu105.html > > For example, if I want to use extended record in objfpc mode, then I >

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Mattias Gaertner via fpc-pascal
On Tue, 10 Mar 2020 00:57:12 -0400 Anthony Walter via fpc-pascal wrote: >[...] > What should happen is that both examples use the function from the > last unit in the uses clause. Yes, that's how Pascal usually works and so it works in pas2js. Strange that fpc does it the other way round. Bug o

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Mattias Gaertner via fpc-pascal
On Tue, 10 Mar 2020 08:11:21 +0100 (CET) Michael Van Canneyt wrote: >[...] > I'm inclined to think you found the reason why Embarcadero disallows > type helpers. That would imply E thought type helpers through. I doubt that, e.g. write access to read only properties. > A type helper extends a

[fpc-pascal] Lazarus Release 2.0.8

2020-04-16 Thread Mattias Gaertner via fpc-pascal
Please read carefully: The Lazarus team is glad to announce the release of Lazarus 2.0.8. This release was built with FPC 3.0.4. The previous release Lazarus 2.0.6 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazar

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
> Ryan Joseph via fpc-pascal hat am 23. April > 2020 um 10:14 geschrieben: > > > > On Apr 23, 2020, at 3:00 PM, Michael Van Canneyt > > wrote: > > > > I think the decision to use the codetoolboss is the best, see above as to > > why. > > Very well. I assume the code tools parses the entir

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
> Ryan Joseph via fpc-pascal hat am 23. April > 2020 um 10:58 geschrieben: > > > > On Apr 23, 2020, at 3:49 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > 3) Class/record member completions. > > I guess you mean identifier completion after a d

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 20:45:58 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 23, 2020, at 8:20 PM, Arjan Adriaanse > > wrote: > > > > Perhaps not all the used generics features are available yet in > > older FPC versions. I use the most recent release candidate from > > ftp://ftp.freepascal

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 20:45:58 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 23, 2020, at 8:20 PM, Arjan Adriaanse > > wrote: > > > > Perhaps not all the used generics features are available yet in > > older FPC versions. I use the most recent release candidate from > > ftp://ftp.freepascal

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 21:41:34 +0700 Ryan Joseph via fpc-pascal wrote: > I just tried update my lazarus sources using "svn up" and now I'm > getting another strange error when using lazbuild. > > /Users/ryanjoseph/Developer/lazarus/components/ideintf/ideintf.pas:11:3: > fatal: Can't find unit Laza

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 21:54:58 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 23, 2020, at 9:51 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > You have old ppu files. > > > > For example: > > make distclean all > > ok, did this a

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 14:12:48 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > In my test I'm getting an error at this block, "Parse error: unit not > found: fpextres". > > Does code tools need access to this unit? It's not part of the source > I've supplied it so I don't know why it's looking fo

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 22:11:54 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 23, 2020, at 10:07 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Please post the last couple of lines, e.g. starting at the last > > ppcx64 call. > > > > /

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 10:59:21 +0200 Arjan Adriaanse wrote: > The options for initializing CodeToolsBoss are passed through > environment variables as described at > https://wiki.lazarus.freepascal.org/Codetools [1]. > > For example, mine are set up as follows through the Emacs client > settings.

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 15:11:26 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > > It does not require lazarus, but it does require the FPC source > > tree. > > Ok then. How do I setup code tools on the FPC source tree? See my mail about SimpleInit. Mattias _

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 16:39:09 +0700 Ryan Joseph via fpc-pascal wrote: > When I hover over a function in Lazarus I get a function definition > and unit location. Is that coming from TCodeManager.FindSmartHint? Yes Mattias ___ fpc-pascal maillist - fpc

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 16:40:14 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 4:35 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > codetools that scans Lazarus packages. > > > > In Short: You can omit LAZARUSDIR. > > > >

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 16:54:43 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 4:49 PM, Mattias Gaertner via fpc-pascal > > wrote: > >> When I hover over a function in Lazarus I get a function definition > >> and unit location. Is that coming from &

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 20:58:45 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 4:54 PM, Ryan Joseph > > wrote: > > > > I'm not able to get this one working then. Is the buffer the > > current file? This is what I'm doing: > > > > > >URI := ParseURI(textDocument.uri); > >

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 21:34:41 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 9:28 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Still FindFile instead of LoadFile? > > > > Do you get all mails from this list? > > I don'

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 12:03:55 +0700 Ryan Joseph via fpc-pascal wrote: > I have FindCodeContext working correctly I believe because ProcName > from TCodeContextInfo returns the correct name of the function. In > TCodeContextInfoItem the params string list is nil though. Shouldn't > that contain the

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 09:02:50 +0200 Mattias Gaertner via fpc-pascal wrote: > On Sat, 25 Apr 2020 12:03:55 +0700 > Ryan Joseph via fpc-pascal wrote: > > > I have FindCodeContext working correctly I believe because ProcName > > from TCodeContextInfo returns the correct nam

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 15:55:44 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 3:32 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Are there any ppu files left after "make distclean"? > > I just trashed the entire thing and star

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 19:29:41 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > Since we're so invested in code tools now what is actually required > for users in terms of Lazarus? Can we just package a single binary > which links to code tools or do users need to install an entire > Lazarus setup?

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 19:43:32 +0700 Ryan Joseph via fpc-pascal wrote: > Is the following line something which can be cached? Currently this > is going to be called very often but is it an expensive operation? > Not sure what it does exactly > > Code := CodeToolBoss.FindFile(URI.Path + URI.Doc

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 21:08:52 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 25, 2020, at 8:49 PM, Michael Van Canneyt > > wrote: > > > > It will run on a server that never installed lazarus. > > Excellent. Where are the caches kept btw? Memory. Mattias __

Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-26 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 15:49:30 +0200 Martin Frb wrote: > On 23/04/2020 22:10, Joost van der Sluis wrote: > > But maybe it should become a separate package now. Lazarus can use > > is as a dependency. We'll see. > > That would then reverse the burden > > As it is part of bigide, it must be s

Re: [fpc-pascal] Pascal Language Server

2020-04-27 Thread Mattias Gaertner via fpc-pascal
On Mon, 27 Apr 2020 22:12:30 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 26, 2020, at 4:46 PM, Ryan Joseph > > wrote: > > > > The other thing I'm stuck on with code tools. In TCodeManagerTool: > > > >function FindReferences(IdentifierCode: TCodeBuffer; > > X, Y: integer; Se

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Mattias Gaertner via fpc-pascal
On Tue, 28 Apr 2020 09:34:36 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 28, 2020, at 4:18 AM, Mattias Gaertner via fpc-pascal > > wrote: >[...] > LSP doesn't have a concept of the "main file" but this seems to > require the main program file to star

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Mattias Gaertner via fpc-pascal
On Tue, 28 Apr 2020 15:34:57 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 28, 2020, at 3:26 PM, Michael Van Canneyt > > wrote: > > > > That's a wrong approach. Pascal units are in a uses-tree. You need > > a starting point, the top of the tree: a single module. > > I can make the user

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Mattias Gaertner via fpc-pascal
On Tue, 28 Apr 2020 20:28:16 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > Speaking of that is there a way in code tools to get a list of > parsing errors that occurred for a given file? It's possible that > parsing fails but I don't know where errors occurred until I make a > query and comes

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Mattias Gaertner via fpc-pascal
On Tue, 28 Apr 2020 20:58:18 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 28, 2020, at 8:52 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Codetoolboss.Error* > > Not sure I'm understand the usage. When do I check for errors and are > t

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Mattias Gaertner via fpc-pascal
On Fri, 1 May 2020 12:31:26 +0700 Ryan Joseph via fpc-pascal wrote: > Stuck on another code tools problem. > > I've been using code like this to find words at node offsets and this > works well until there are $ifdefs in the file and then the text > position getting offset and fail to return the

  1   2   3   >