Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Ryan Joseph via fpc-pascal
> On May 1, 2020, at 2:42 PM, Mattias Gaertner via fpc-pascal > wrote: > > The Node.StartPos are referring to the Tool.Scanner.CleanedSrc, which is > the code stripped of skipped $ifdef ranges and include files included. That's what I was missing. Thanks again. Regards,

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Ryan Joseph via fpc-pascal
eed to reference the cache myself? Code := CodeToolBoss.LoadFile(Path,false,false); if not CodeToolBoss.Explore(Code,Tool,false,false) then exit; WalkTree(Tool.Tree.Root); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Ryan Joseph via fpc-pascal
for the list. > > On Fri, 1 May 2020 16:27:46 +0700 > Ryan Joseph via fpc-pascal wrote: > >> Ok, got things working now. Here's the basic pattern I'm using. I >> call explore and then walk the root tree node to find what I need but >> i've noticed the 2

[fpc-pascal] TFPGMap retrieving values

2020-05-01 Thread Ryan Joseph via fpc-pascal
; if Dir < 0 then L := I+1 else begin R := I-1; if Dir = 0 then begin Result := true; if Duplicates <> dupAccept then L := I; end; end; end; Index := L; end; Regards, Ryan Joseph

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Ryan Joseph via fpc-pascal
calling it. When does the actual node tree get built then? I just want to load the file and step through the nodes like I explained earlier. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freep

Re: [fpc-pascal] TFPGMap retrieving values

2020-05-01 Thread Ryan Joseph via fpc-pascal
he cuckoo maps. However, as they are not hash maps, their usage is extremely slow, even if the maps are sorted, so they are nearly useless as maps. Their default setting of unsorted and (in case of TStringList) case-insensitive matching are quite dangerous

Re: [fpc-pascal] TFPGMap retrieving values

2020-05-01 Thread Ryan Joseph via fpc-pascal
with FPC > and third party ones) and compare them. and btw, why isn't there a TFPGHashList? I can't find one anyways. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Ryan Joseph via fpc-pascal
e tools questions to a new thread now and keep this one for the language server. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Concat TCollection?

2020-05-03 Thread Ryan Joseph via fpc-pascal
tem of the collection? There could be 1+ items so it's important that I reuse the existing collections. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Concat TCollection?

2020-05-03 Thread Ryan Joseph via fpc-pascal
ists are being kept alive because they may need to be streamed also. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Name collisions in scoped enums

2020-05-03 Thread Ryan Joseph via fpc-pascal
r: Syntax error, "identifier" expected but "FILE" found type TSet = set of ( File, Array ); begin end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Empty Set in constants in generics

2020-05-03 Thread Ryan Joseph via fpc-pascal
here type // error: Incompatible types: got "Empty Set" expected "TItems" TType = specialize GType<[]>; begin end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.free

Re: [fpc-pascal] Name collisions in scoped enums

2020-05-04 Thread Ryan Joseph via fpc-pascal
e those names freed up also if it was safe. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Name collisions in scoped enums

2020-05-04 Thread Ryan Joseph via fpc-pascal
ames(names: TNames); you can call it as SayNames([A, B]); and this is valid because of the context. Is that possible to implement in scoped enums? It's a nice time saver to not have to deal with the prefix when the context is correct but you still get the namespace protecti

Re: [fpc-pascal] Empty Set in constants in generics

2020-05-04 Thread Ryan Joseph via fpc-pascal
> On May 5, 2020, at 1:03 AM, Sven Barth wrote: > > Yes, they should indeed. > https://bugs.freepascal.org/view.php?id=37020 Found another one yesterday also but it's a crash https://bugs.freepascal.org/view.php?id=37014 I think it's a PPU problem. Regard

Re: [fpc-pascal] Name collisions in scoped enums

2020-05-04 Thread Ryan Joseph via fpc-pascal
ed as a CompassPoint, you can set it to a different CompassPoint value using a shorter dot syntax: • directionToHead = .east Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC development guiding.

2020-05-05 Thread Ryan Joseph via fpc-pascal
used in the surrounding area but I would like to have a final say on that. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Name collisions in scoped enums

2020-05-05 Thread Ryan Joseph via fpc-pascal
to call". This example might appear > constructed, but imagine these to procedures coming from two different, > unrelated units. I wonder how Swift accomplished this then. Anyways, I thought it was a nice feature in Swift but it's not important at all. Regards, Ryan Joseph ___

[fpc-pascal] Code tools and constants in generics

2020-05-05 Thread Ryan Joseph via fpc-pascal
As to be expected with new feature code tools now fails with constants in generics. Should I make a bug report to fix this? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin

[fpc-pascal] Code tools unrelated completions

2020-05-05 Thread Ryan Joseph via fpc-pascal
em if possible. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Code tools unrelated completions

2020-05-05 Thread Ryan Joseph via fpc-pascal
er. > You should check for that and filter out these results. AFAIK they are not meant to be called by users so I'd like to filter them out. how do we get function modifiers for TIdentifierListItem then? Regards, Ryan Joseph ___

Re: [fpc-pascal] Code tools unrelated completions

2020-05-05 Thread Ryan Joseph via fpc-pascal
formation btw? That was the first place I got confused by since I expected them to have lots of meta data along with them. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Code tools and constants in generics

2020-05-05 Thread Ryan Joseph via fpc-pascal
> On May 5, 2020, at 3:54 PM, Michael Van Canneyt > wrote: > > On Tue, 5 May 2020, Ryan Joseph via fpc-pascal wrote: > >> As to be expected with new feature code tools now fails with constants in >> generics. Should I make a bug report to fix this? > > Y

[fpc-pascal] BSON formatter

2020-05-06 Thread Ryan Joseph via fpc-pascal
implement but I thought I would ask first. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Using include files in code tools

2020-05-07 Thread Ryan Joseph via fpc-pascal
this information so I can get navigate to the include file AND relative text offset into the include file text. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinf

Re: [fpc-pascal] Using include files in code tools

2020-05-07 Thread Ryan Joseph via fpc-pascal
lude file. I'm collecting the symbols so that I can return them to the client and it can navigate to a particular file at a line/column number. The file which I navigate to must be the include file but I only have those location relative to the unit, not the include. Regards,

Re: [fpc-pascal] BSON formatter

2020-05-07 Thread Ryan Joseph via fpc-pascal
guess. Computers just keep getting slower and slower sometimes it feels... Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] BSON formatter

2020-05-07 Thread Ryan Joseph via fpc-pascal
n talking to the LSP people at ST and they tell me it's really common for servers to be written in JavaScript because it's easily supported within VSCode's architecture (which Electron I'm sure you know). They may have written the thing in Jav

Re: [fpc-pascal] Using include files in code tools

2020-05-09 Thread Ryan Joseph via fpc-pascal
> On May 7, 2020, at 8:21 PM, Ryan Joseph wrote: > >>> I need this information so I can get navigate to the include file AND >>> relative text offset into the include file text. >> >> There are plenty of functions for include files. Can you give an >>

Re: [fpc-pascal] Using include files in code tools

2020-05-09 Thread Ryan Joseph via fpc-pascal
? That would be helpful because otherwise I need to call CleanPosToCaret on every symbol regardless of where it came from. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/m

Re: [fpc-pascal] Using include files in code tools

2020-05-09 Thread Ryan Joseph via fpc-pascal
> On May 10, 2020, at 1:20 AM, Mattias Gaertner via fpc-pascal > wrote: > > CleanPosToCaret is using a binary search. Compared to the other > operations like parsing, this is is hardly measurable. Thanks, I got it working now. Regards,

[fpc-pascal] Code tools search paths

2020-05-10 Thread Ryan Joseph via fpc-pascal
this? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Code tools search paths

2020-05-10 Thread Ryan Joseph via fpc-pascal
e -Fu and -d with it. Are include paths and unit paths the same? I just see TDefineTemplate which seems to do both. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Code tools search paths

2020-05-11 Thread Ryan Joseph via fpc-pascal
> On May 11, 2020, at 10:56 AM, Ryan Joseph wrote: > > Ok, I'll move to this. What are the FPC options for then? I thought I could > do things like -Fu and -d with it. > > Are include paths and unit paths the same? I just see TDefineTemplate which > seems

Re: [fpc-pascal] Code tools search paths

2020-05-11 Thread Ryan Joseph via fpc-pascal
than what I'm doing with the define templates but maybe I'm confused (see my follow up I just sent). Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Code tools search paths

2020-05-11 Thread Ryan Joseph via fpc-pascal
the program and another direction to test units in other directories so I basically just want: pp /path/to/test.pas -Fu/path/to/other_units Pretty simple but I don't seem to be going about it correctly. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Code tools search paths

2020-05-12 Thread Ryan Joseph via fpc-pascal
> On May 11, 2020, at 8:02 PM, Ryan Joseph wrote: > > I wanted this to behave like the compiler normally does, that is you supply > paths to the units with -Fu and includes with -Fi. What is the way to achieve > that here? > > For example in my test project I ha

[fpc-pascal] Code tools and changing include file text

2020-05-12 Thread Ryan Joseph via fpc-pascal
main code doesn't seem to get updated. Do I need to notify the main code of changes or inject the include code into the main code buffer? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepas

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-21 Thread Ryan Joseph via fpc-pascal
I get it cleaned up it will be usable also. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] TFPGList and objects

2020-05-28 Thread Ryan Joseph via fpc-pascal
Invocation" = "TInvocation" I wanted it for other reasons but we can consider the patch now to add class operators to objects? https://bugs.freepascal.org/view.php?id=36350 Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pa

Re: [fpc-pascal] TFPGList and objects

2020-05-28 Thread Ryan Joseph via fpc-pascal
the record which means I need to 1) not use TFPGList 2) change to a class and all the memory implications that come with that. If we could also objects to allow class operators then we can have a solution to this problem. Regards, Ryan Joseph ___

[fpc-pascal] get class of procedure variable

2020-05-29 Thread Ryan Joseph via fpc-pascal
d method pointer but I don't know how to access it. type TCallback = procedure of object; var callback: TCallback; obj: TObject; begin callback := obj.SomeMethod; // get the class which callback is assigned to if callback.GetClass = X

Re: [fpc-pascal] get class of procedure variable

2020-05-29 Thread Ryan Joseph via fpc-pascal
> On May 29, 2020, at 2:15 PM, Michael Van Canneyt > wrote: > > I think what you're looking for is: > > if TMethod(CallBack).Data=XXX then TMethod is exactly what I was looking for. Thank you Michael. Regards, Ryan Joseph ___

[fpc-pascal] Codetools generic constants

2020-06-25 Thread Ryan Joseph via fpc-pascal
EndChildNode; end else begin if AtomIs('>=') then begin // this is the rare case where >= are two separate atoms dec(CurPos.EndPos); LastAtoms.SetCurrent(CurPos); end; if not AtomIsChar('>') then SaveRaiseCharExpectedButAtomFound(20170421

[fpc-pascal] Codetools find references

2020-06-26 Thread Ryan Joseph via fpc-pascal
s/FPC/TestCodeTools'); InitCodeTools([ '-Fu'+ExpandFileName('./test/units'), '-Fi'+ExpandFileName('./test/include') ]); ProgramPath := ExpandFileName('./test/test.pas'); Path := ProgramPath; writeln('main program: ', ProgramPath); FindReferences(Path, ProgramPath, 11, 13); end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] CodeTools reduce number of completions

2020-07-01 Thread Ryan Joseph via fpc-pascal
CodeTools to ignore certain units or any other way to reduce the number of results? One option would be return results in partial batches (Language Server Protocol) supports this but again I'm not sure if CodeTools supports this or not. Regards,

Re: [fpc-pascal] CodeTools reduce number of completions

2020-07-01 Thread Ryan Joseph via fpc-pascal
so but then I get syntax errors in CodeTools which prevents it from searching files. Ignoring those errors would be another possible solution. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] CodeTools reduce number of completions

2020-07-01 Thread Ryan Joseph via fpc-pascal
> On Jul 2, 2020, at 8:05 AM, Ryan Joseph wrote: > > The majority of the work takes place in GatherIdentifiers. This is because > MacOSAll and CocoaAll units. They're just massive files so I'm not sure what > we can do about them. I think I was wrong about this bein

Re: [fpc-pascal] CodeTools reduce number of completions

2020-07-02 Thread Ryan Joseph via fpc-pascal
e your attention, any idea about that FindReferences bug I reported some days? Still haven't figured it out yet. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Codetools, identity nodes from includes

2020-07-05 Thread Ryan Joseph via fpc-pascal
displayed according to the LSP. Given a TCodeTreeNode can I identity if the node came from an include file or not so I can ignore it? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.o

Re: [fpc-pascal] Codetools, identity nodes from includes

2020-07-07 Thread Ryan Joseph via fpc-pascal
;0 then >// dangling node, e.g. syntax error > else >InIncludeFile:=Scanner.LinkP[LinkIndex]^.Code<>Scanner.MainCode; > end else > ; // artificial node, e.g. intrinsic works well, thanks. Regards, Ryan Joseph __

Re: [fpc-pascal] fpDebug function-call proof-of-concept

2020-07-08 Thread Ryan Joseph via fpc-pascal
er which is spawned in another process works (like the Pascal server, which is written in Pascal). I have very little JavaScript knowledge which doesn't help either. :) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.fre

[fpc-pascal] What happens when assigning interfaces?

2020-07-09 Thread Ryan Joseph via fpc-pascal
nk they do. {$mode objfpc} {$interfaces corba} program unit_name; type IFoo = interface ['IFoo'] end; type TMyClass = class (IFoo) end; procedure DoSomething(i: IFoo); begin end; var f: IFoo; c: TMyClass; begin // case A f := c; // case B DoSomething(c); end. R

Re: [fpc-pascal] What happens when assigning interfaces?

2020-07-09 Thread Ryan Joseph via fpc-pascal
it have to do a lookup to find the VMT table, like calling Supports() does? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] What happens when assigning interfaces?

2020-07-10 Thread Ryan Joseph via fpc-pascal
ally curious about, when are runtime checks performed vs compile time checks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] YAML parser

2020-08-03 Thread Ryan Joseph via fpc-pascal
Is there any YAML parser that exists for FPC? Couldn't seem to find one despite YAML being a pretty popular format. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/ma

[fpc-pascal] Null values with JSON RPC

2020-08-07 Thread Ryan Joseph via fpc-pascal
Null value"},"id":1} According to the protocol null values are allowed so is there a way I can accept null values gracefully instead of failing with an error? In particular rootPath is trying to be mapped to a string so it could be translated to just '' and that w

Re: [fpc-pascal] Null values with JSON RPC

2020-08-07 Thread Ryan Joseph via fpc-pascal
d to modify the FPC serialization code or use a nullable string type instead of AnsiString. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Null values with JSON RPC

2020-08-07 Thread Ryan Joseph via fpc-pascal
ght now and setting that option still seems to give the same error. I'll look into it more tomorrow when I have some time. There's seems to be a DoRestoreProperty override which could be interesting but I'm not sure if the error is trigger before her

Re: [fpc-pascal] Null values with JSON RPC

2020-08-07 Thread Ryan Joseph via fpc-pascal
27;m not getting anything deserialized now. Maybe something else is the culprit but it's totally broken now for some reason. Can you test and confirm this? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https:

Re: [fpc-pascal] Null values with JSON RPC

2020-08-08 Thread Ryan Joseph via fpc-pascal
how it works very well. Normally I would just add paths to directories and I need but that's not an option with lazbuilds package system. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Null values with JSON RPC

2020-08-08 Thread Ryan Joseph via fpc-pascal
> On Aug 8, 2020, at 8:24 PM, Michael Van Canneyt > wrote: > > make clean make install PREFIX=/some/dir/on/your/system what is the PREFIX part? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepasc

Re: [fpc-pascal] Null values with JSON RPC

2020-08-08 Thread Ryan Joseph via fpc-pascal
arning: Removed non empty directory "univint/units/x86_64-darwin/" make: *** No rule to make target `make'. Stop. packages$ Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Language server extension for VSCode

2020-08-11 Thread Ryan Joseph via fpc-pascal
y Mac. Having a person test on Windows would be nice help. I should put the vsix file in a GitHub release but for now get the whole repo. https://github.com/genericptr/pasls-vscode Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists

[fpc-pascal] 3.2.0 Invalid PPU Version

2020-08-12 Thread Ryan Joseph via fpc-pascal
Does anyone have any idea how this happened? I installed 3.2.0 from an installer so why is the PPU version wrong? PPU Loading /usr/local/lib/fpc/3.2.0/units/x86_64-darwin/fcl-process/process.ppu PPU Invalid Version 208 Regards, Ryan Joseph

Re: [fpc-pascal] 3.2.0 Invalid PPU Version

2020-08-12 Thread Ryan Joseph via fpc-pascal
gs: 159873 (SYSTEM) PPU Crc: 798FAFCC (SYSTEM) PPU Crc: A0492A36 (intfc) (SYSTEM) PPU Crc: BDAFAB66 (indc) (SYSTEM) Number of definitions: 2625 (SYSTEM) Number of symbols: 8067 (SYSTEM) PPU Source: system.pp not available Regards, Ryan Joseph _

Re: [fpc-pascal] 3.2.0 Invalid PPU Version

2020-08-12 Thread Ryan Joseph via fpc-pascal
-darwin/fcl-process/process.ppu (PROCESS) PPU Invalid Version 208 PPU Loading /usr/local/lib/fpc/3.2.0/units/x86_64-darwin/fcl-process/process.ppu empty.pas(5,3) Fatal: Can't find unit process used by test Fatal: Compilation aborted Error: /usr/local/bin/ppcx64 returned an e

[fpc-pascal] RTL semaphore supported?

2020-08-12 Thread Ryan Joseph via fpc-pascal
Are semaphores actually supported in the RTL? I don't see they're available on macOS (compiling with trunk even). https://www.freepascal.org/docs-html/3.0.0/rtl/system/semaphoreinit.html Regards, Ryan Joseph ___ fpc-pascal mailli

Re: [fpc-pascal] RTL semaphore supported?

2020-08-13 Thread Ryan Joseph via fpc-pascal
> On Aug 13, 2020, at 12:42 PM, Sven Barth wrote: > > The way to go with semaphores would be to implement the Delphi compatible > TSemaphore in the unit SyncObjs. Link? I'm looking at https://www.freepascal.org/docs-html/fcl/syncobjs/index-4.html and I don't see it.

Re: [fpc-pascal] Procedural generics question

2020-08-26 Thread Ryan Joseph via fpc-pascal
on for the compiler team why doesn't the "is" operator work for types? We should be able to do: if T is integer then ; and get something which is well optimized. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.

Re: [fpc-pascal] Procedural generics question

2020-08-26 Thread Ryan Joseph via fpc-pascal
dd for the is operator. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] fpcmake packaging

2020-09-01 Thread Ryan Joseph via fpc-pascal
place some patterns in the file to reflect the build version Are those the kind of things fpcmake can do or do I need another build system for this? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] fpcmake packaging

2020-09-01 Thread Ryan Joseph via fpc-pascal
se it all the time for > building production versions of lazarus programs and prior to packaging the > programs and resources in .deb and .rpm files. > > On 01/09/2020 13:37, Ryan Joseph via fpc-pascal wrote: > Apparently there is fpmake and fpcmake, which I didn't know.

Re: [fpc-pascal] fpcmake packaging

2020-09-02 Thread Ryan Joseph via fpc-pascal
imidating but I guess I need to try since it appears to do what I want. You said I can call external scripts which is pretty interesting also because I may have some edge cases with macOS stuff. Regards, Ryan Joseph ___ fpc-pascal maillist -

Re: [fpc-pascal] TFPObjectlist example

2020-09-06 Thread Ryan Joseph via fpc-pascal
ee; in that example the object added to the list won't leak memory but it will be freed when the list itself is freed. or list:= TFPObjectlist.Create; list.Add(TObject.Create); list.Delete(0); will also not leak memory. Regards, Ryan Joseph _

Re: [fpc-pascal] Help with TList example

2020-09-08 Thread Ryan Joseph via fpc-pascal
n array of pointers (objects allocated on the stack) or an array of records (i.e. one continuous block of memory? I you want an array of pointers try using classes as mentioned or if you want an array of records try TFPGList and specialize for your record type.

Re: [fpc-pascal] -Fu unit search path and network paths

2020-09-21 Thread Ryan Joseph via fpc-pascal
> On Sep 21, 2020, at 2:16 PM, LacaK via fpc-pascal > wrote: > > when I use in *uses* clause: I never knew "in" even existed! This totally blows my mind. Was it something added from Delphi that I never heard about? Regard

[fpc-pascal] TFPGMapObject duplicate errors

2020-10-01 Thread Ryan Joseph via fpc-pascal
#x27;foo', TObject.Create); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TFPGMapObject duplicate errors

2020-10-02 Thread Ryan Joseph via fpc-pascal
> On Oct 1, 2020, at 7:00 PM, Vojtěch Čihák via fpc-pascal > wrote: > > I looked to code, it gives error only when map is Sorted=True. > Thanks. Sneaky that sorted had to be set to true. Not sure why that would be. Regards,

[fpc-pascal] Merging units

2020-10-02 Thread Ryan Joseph via fpc-pascal
deas of solutions or preferred approaches? Is it feasible to add an "imports" clause to Pascal or are there other pitfalls? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Converting date formats

2020-10-03 Thread Ryan Joseph via fpc-pascal
I have some dates formats like this which I would like to convert to TDateTime. Are these supported in the RTL? I tried using the StrToDate functions but I got errors. program test; uses SysUtils; begin StrToDate('2001-12-14T21:59:43.10Z-05:00'); end. Regards, R

Re: [fpc-pascal] Converting date formats

2020-10-03 Thread Ryan Joseph via fpc-pascal
i) that handles timezones and whatnot. I have no idea about dates and where to find these functions in the RTL. I just saw the date at https://tools.ietf.org/html/rfc3339. What do those links say about it not being possible? ISO8601ToDate seems to work if I change the decimal representation

Re: [fpc-pascal] Converting date formats

2020-10-03 Thread Ryan Joseph via fpc-pascal
ecimal precision for the seconds. According to the spec I was following I didn't see any timezones, just a local time with an offset from UTC. I don't understand why this is preferable to timezones however. It's all very confusing if you ask me. Regards, Ryan Joseph ___

[fpc-pascal] TOML parser

2020-10-03 Thread Ryan Joseph via fpc-pascal
s still not 100% complete but that's all I have time for right now. If this is of interest for the RTL let me know and I'll make whatever changes are required for it to be eligible/submitted. https://github.com/genericptr/fpTOML On the TOML format: https://toml.io Reg

[fpc-pascal] Adding file to string to the RTL

2020-10-05 Thread Ryan Joseph via fpc-pascal
gList but that's the closest thing I found in the RTL. function ReadFile(path: Ansistring): Ansistring; var list: TStringList; begin list := TStringList.Create; list.LoadFromFile(ExpandFileName(path)); result := list.Text; list.Free; end; Regards, R

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-05 Thread Ryan Joseph via fpc-pascal
cient and I've never used it before honestly). Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-05 Thread Ryan Joseph via fpc-pascal
know enough about text formats but using AnsiString always just seems to work for me (I assume the compiler did something magic behind the scenes). Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-06 Thread Ryan Joseph via fpc-pascal
an UTF-8 encoding for unicode otherwise it assumes ASCII format? I didn't specify the encoding with TStringList and I always seemed to get back what I wanted (maybe it sniffed the encoding from the file?). Regards, Ryan Joseph ___ fpc-p

Re: [fpc-pascal] Merging units

2020-10-06 Thread Ryan Joseph via fpc-pascal
some while ago when I asked. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-06 Thread Ryan Joseph via fpc-pascal
l text files in a directory. // only 2 lines doesn't leak memory for name in FindAllFiles('/usr/local/lib/fpc') do writeln(GetFileAsString('/usr/local/lib/fpc/'+name)); end. Regards, Ryan Joseph ___ fpc-pasca

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-06 Thread Ryan Joseph via fpc-pascal
projects so I'm looking forward to killing it. ;) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-07 Thread Ryan Joseph via fpc-pascal
s like Lazarus has FindAllFiles but it doesn't return a dynamic array (the important part so it can be dropped into for..in loops). Many scripting languages have a similar function (I can think of C#, PHP, Python and Javascript off the top of my head). Regar

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-07 Thread Ryan Joseph via fpc-pascal
;Directory "'+path+'"" doesn''t exist'); result.path := path+DirectorySeparator+'*'; result.count := 0; end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] uses in '' relative paths

2020-10-07 Thread Ryan Joseph via fpc-pascal
ot;/sources" thus making it easier to include the main unit but maybe that's not how the "uses in" syntax works. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] uses in '' relative paths

2020-10-07 Thread Ryan Joseph via fpc-pascal
ser like this: unit TOML; interface uses TOMLParser in 'sources/TOMLParser.pas', Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] uses in '' relative paths

2020-10-08 Thread Ryan Joseph via fpc-pascal
> On Oct 7, 2020, at 11:15 AM, Ryan Joseph wrote: > > Some interesting stuff here, thanks. Almost there but for some reason > Scanner.pas is not found even though it's in the same directory as > TOMLParser.pas. The compiler did find TOMLParser despite /sources not

Re: [fpc-pascal] Are record fields zeroed on declaration of a record?

2020-10-08 Thread Ryan Joseph via fpc-pascal
cord = record X, Y: Integer = 0; S: String = ''; end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-08 Thread Ryan Joseph via fpc-pascal
g/File_Handling_In_Pascal which offers a whole host of options. SaveStringToFile from the wiki link wraps TFileStream but having a single low-level function would be best. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-08 Thread Ryan Joseph via fpc-pascal
at's best for the RTL though honestly. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Are record fields zeroed on declaration of a record?

2020-10-09 Thread Ryan Joseph via fpc-pascal
tic; // this syntax works. class operator Initialize(var self: TMyRec); // init operator gets called when the record is declared end; var charlie: TmyRec = (a:2; b:3; e:3.1415); begin charlie := TmyRec(a:2; b:3; e:3.1415); // this would be a nice addition to avoid constructors Re

<    5   6   7   8   9   10   11   12   >