Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Ryan Joseph via fpc-pascal
I mean if in theory you were to inline that function variables code into the function it would need to generate a new function (I guess the name also, so the entire thing) because the function being passed in could change on per-call basis (like a normal generic function)

Re: [fpc-pascal] Keeping current with FPC Source on gitlab

2021-11-05 Thread Ryan Joseph via fpc-pascal
quot;trunk" location so that it doesn't overwrite existing stable compiler releases. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] ExtractStrings by line in Windows

2021-11-04 Thread Ryan Joseph via fpc-pascal
> On Nov 3, 2021, at 8:17 PM, Bart via fpc-pascal > wrote: > > Maybe use SomeString.Split([LineEnding'], ...)? > Split has an overload that takes an array of string as first paramter. Thanks, I guess I need to use a different way to work on all platforms. Regards,

Re: [fpc-pascal] First Version Vector Toolkit in OpenGL

2021-11-06 Thread Ryan Joseph via fpc-pascal
iased way then. I really like the text rendering part. I've been picking away at that problem recently and it's pretty difficult to do correctly. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.

[fpc-pascal] Inline function parameters

2021-11-06 Thread Ryan Joseph via fpc-pascal
t possible. === type TSomeFunc = function: boolean; procedure DoThis(func: TSomeFunc); begin if func then ; end; function MyFunc: boolean; inline; begin end; begin DoThis(MyFunc); end; Regards, Ryan Joseph ___ fpc-pascal maillist -

Re: [fpc-pascal] Inline function parameters

2021-11-07 Thread Ryan Joseph via fpc-pascal
tically possible through constant propagation. I understand simple constant propagation cases but how does this apply to inlining entire functions? I think C++ can do this with closures so it's something worth looking in to for the future. Regards, Ryan Joseph __

Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Ryan Joseph via fpc-pascal
* 2; { MultBy2 is inlined here } 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] First Version Vector Toolkit in OpenGL

2021-10-31 Thread Ryan Joseph via fpc-pascal
n layer (frame buffer) which updates only when controls request it and update only that portion of the window. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] String error on Windows

2021-10-31 Thread Ryan Joseph via fpc-pascal
with -vt and check where the > compiler is getting its configuration file from. Thanks, I see -Sc now but I've always taken for granted it was always there. What confused me is that it's a command line option instead of a mode switch like other language features. Regards

Re: [fpc-pascal] Lazbuild error on Windows

2021-10-28 Thread Ryan Joseph via fpc-pascal
That would make sense it would fail then. Let me try downloading the correct version and I'll report back. If Lazarus installed the compiler also maybe I just need to update my paths so "fpc" points to the version in Lazarus... Thanks. Reg

Re: [fpc-pascal] Writing Pascal Physics and Vectors

2021-10-28 Thread Ryan Joseph via fpc-pascal
Box2D which was C++ only. https://github.com/thealchemistguild/Box2DC Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazbuild error on Windows

2021-10-28 Thread Ryan Joseph via fpc-pascal
an installer so I don't know how else to set it up. PS C:\Users\Ryan Joseph\Desktop\Developer\pascal-language-server> C:\lazarus\lazbuild.exe pasls.lpi SetupCompilerFilename: The compiler path "$Lazarusdir\fpc\3.2.0\bin\i386-win32\fpc.exe" => "C:\lazarus\$Lazarusdir\fpc\3.2.0\b

Re: [fpc-pascal] Named optional arguments

2021-12-01 Thread Ryan Joseph via fpc-pascal
ke my idea of default properties for records so we can implement smart pointers? I got a good chunk of that done months ago but never heard anything about 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] TProcess read buffer size

2021-07-16 Thread Ryan Joseph via fpc-pascal
seconds to read a 600MB file from one process to another, which is insanely slow. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] TProcess read buffer size

2021-07-15 Thread Ryan Joseph via fpc-pascal
has no affect. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TProcess read buffer size

2021-07-15 Thread Ryan Joseph via fpc-pascal
it could come from. How could I test this further? I think something is wrong but I don't know where to look. I'm on macOS btw. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bi

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Ryan Joseph via fpc-pascal
to basically redo the entire thing also). Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Case statement for class introspection

2022-01-17 Thread Ryan Joseph via fpc-pascal
); the address changes every time the program reloads (as expected) so how do you use a constant memory address which would map to this? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/

Re: [fpc-pascal] Case statement for class introspection

2022-01-15 Thread Ryan Joseph via fpc-pascal
is a possibility for using "as" operator also though Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Case statement for class introspection

2022-01-15 Thread Ryan Joseph via fpc-pascal
> On Jan 16, 2022, at 9:21 AM, Ryan Joseph wrote: > > There is a possibility for using "as" operator also though oops I mean "is" operator. Not sure if these are technically different from ClassType = ClassType though...

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Ryan Joseph via fpc-pascal
t know why I forgot that. :P Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Ryan Joseph via fpc-pascal
acedObject: writeln('TInterfacedObject'); TAggregatedObject: writeln('TAggregatedObject'); otherwise writeln('OTHER: ',o.ClassName); end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Ryan Joseph via fpc-pascal
> On Jan 16, 2022, at 8:18 PM, Ryan Joseph wrote: > > https://gitlab.com/genericptr/free-pascal/-/commits/case_label_classref I just realized too late that the way I implemented this may be not the best idea. If the class type had an ordinal representation then you could use a no

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Ryan Joseph via fpc-pascal
he class if it didn't exist in the list. It's an incomplete code snippet but if the class was another type it would be captured there of course. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.f

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Ryan Joseph via fpc-pascal
> On Jan 16, 2022, at 9:01 PM, Ryan Joseph wrote: > > case PtrUInt(o.ClassType) of >4500656856: writeln('TObject'); > end; I may have spoken too soon and without thinking the through clearly (it's getting late here!). For this to work we would need a unique ID in the

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-14 Thread Ryan Joseph via fpc-pascal
us what this type actually is also, maybe a dispatch table which wraps the existing types or is it something totally new? type TMyAction = reference to procedure; procedure DoThis(action: TMyAction); begin action(); end; Regards, Ryan Joseph _

[fpc-pascal] Caller agnostic procedure variables

2022-02-14 Thread Ryan Joseph via fpc-pascal
ror: Incompatible type for arg no. 1: Got "", expected "" // normal DoThis(@MyAction); end; begin 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] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
ns "reference to procedure" is not compatible with "is nested"? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
es at all or does it use a totally different mechanism to call those? type TMyAction = reference to procedure; procedure MyAction; begin end; procedure Test; begin DoThis(@MyAction); end; Regards, Ryan Joseph __

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
this object is not clear to me so I'll wait for Sven to answer 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] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
on body? I guess that makes sense on how it can "capture" these different types of functions. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
function reference to a nested function variable is hard as well. > I'm getting lost with the terms now I think. If your function takes a function reference parameter and you assign it a nested function pointer, this is difficult? I believe this was Michaels request in that code snip

Re: [fpc-pascal] bug or feature?

2022-02-12 Thread Ryan Joseph via fpc-pascal
> On Feb 12, 2022, at 11:40 PM, Jonas Maebe via fpc-pascal > wrote: > > I wouldn't consider this to be working by design, but rather because of > implementation limitations. I agree and it should be fixed probably. Regards,

[fpc-pascal] Bit manipulation helpers

2022-02-21 Thread Ryan Joseph via fpc-pascal
GetBit (from the last link) in the RTL? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Bit manipulation helpers

2022-02-21 Thread Ryan Joseph via fpc-pascal
t flag APIs where all the flags are OR'd together into an LongWord? A type helper would be great because clearly this stuff is hard to remember. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.f

Re: [fpc-pascal] Bit manipulation helpers

2022-02-21 Thread Ryan Joseph via fpc-pascal
s := KMOD_LCTRL + KMOD_RCTRL; writeln('TestBit: ', flags.TestBit(KMOD_LCTRL)); writeln('TestFlag: ', TestFlag(flags, KMOD_LCTRL)); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
h: var n: TFoobarNested; begin f := n; THAT would be hard? I've never passed around nested function vars before so I don't really know the limitations of this. The important thing is the primary use case works. Regards, Ryan Joseph ___ fpc-pa

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
> On Feb 16, 2022, at 12:18 AM, Thomas Kurz via fpc-pascal > wrote: > > What release are anonymous functions planed for? FPC 3.4.0? They aren't even in trunk yet. Could be months or years. Regards, Ryan Joseph ___ fpc-pas

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
the runtime cost to use these. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] $PASCALMAINNAME error with SDL/IPhone

2022-02-02 Thread Ryan Joseph via fpc-pascal
> On Feb 1, 2022, at 9:22 PM, Ryan Joseph wrote: > > > If anyone understands SDL I figured out how to get around this missing main > linker error and program runs but then crashes. I've reported to SDL at > https://discourse.libsdl.org/t/crash-in-uitextfield/34711 (along

Re: [fpc-pascal] Macro expanding error

2022-01-27 Thread Ryan Joseph via fpc-pascal
undef would have been smart also. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] $PASCALMAINNAME error with SDL/IPhone

2022-01-31 Thread Ryan Joseph via fpc-pascal
ut to your main function. I had old code from 2016 which appears to do this but for some reason now I'm getting this linker error. My only guess is that the linker can't find the SDL main function in the framework, even though everything else links properly. Reg

[fpc-pascal] $PASCALMAINNAME error with SDL/IPhone

2022-01-30 Thread Ryan Joseph via fpc-pascal
t for main executable (maybe you meant: _SDL_main) Why is 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] $PASCALMAINNAME error with SDL/IPhone

2022-02-01 Thread Ryan Joseph via fpc-pascal
> On Feb 1, 2022, at 9:34 AM, Ryan Joseph wrote: > > My only guess is that the linker can't find the SDL main function in the > framework, even though everything else links properly. If anyone understands SDL I figured out how to get around this missing main linker error and

Re: [fpc-pascal] Case statement for class introspection

2022-01-14 Thread Ryan Joseph via fpc-pascal
look kind of like this: for case monster as TZenChan in monsters do TZenChan(monster).Dothis; That syntax is not so nice but I like they're trying to help us manage class introspection using existing language constructs. Regards, Ryan Joseph

[fpc-pascal] Case statement for class introspection

2022-01-14 Thread Ryan Joseph via fpc-pascal
(monster).DoThat; otherwise monster.DoSomething; 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] Case statement for class introspection

2022-01-18 Thread Ryan Joseph via fpc-pascal
ould clutter up the system but I'll make a merge request if you want. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Case statement for class introspection

2022-01-18 Thread Ryan Joseph via fpc-pascal
org/FPC_git#Update Sorry I'm not following. Before starting this branch I did a pull from the main branch so I'm up to date. What other steps do I need to do? If I do a "git pull --rebase" on the feature branch does that even do anything?

Re: [fpc-pascal] Case statement for class introspection

2022-01-19 Thread Ryan Joseph via fpc-pascal
.') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. A pull didn't help but I think I basically broke that branch and maybe I need to delete it and start over? Regards, Ryan Joseph ___ fpc-pasca

Re: [fpc-pascal] Case statement for class introspection

2022-01-19 Thread Ryan Joseph via fpc-pascal
> On Jan 19, 2022, at 8:14 PM, Ryan Joseph wrote: > > Ok I got this almost done (mirroring is great I didn't know I could do that) > and did the rebase which shows the linear history now. > > First a question, do I need to do the "rebase main" again before

Re: [fpc-pascal] Case statement for class introspection

2022-01-20 Thread Ryan Joseph via fpc-pascal
> On Jan 20, 2022, at 9:11 AM, Ryan Joseph wrote: > > The problem was my remote for the branch got lost after rebasing but I think > I fixed it by re-pulling. > > It looks like some unrelated commits are included in my merge request but > maybe that happened because I r

Re: [fpc-pascal] Case statement for class introspection

2022-01-20 Thread Ryan Joseph via fpc-pascal
> On Jan 20, 2022, at 8:10 PM, Ryan Joseph wrote: > > I just check at https://gitlab.com/freepascal.org/fpc/source/-/merge_requests > and I don't see my merge request appeared. If it were GitHub I would expect > to see it there. What did I do wrong? So what I did was created

Re: [fpc-pascal] Case statement for class introspection

2022-01-19 Thread Ryan Joseph via fpc-pascal
do a pull-rebase from main and then make my pull request? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Case statement for class introspection

2022-01-19 Thread Ryan Joseph via fpc-pascal
> On Jan 19, 2022, at 4:19 PM, Ryan Joseph wrote: > > Still not following this. Do you need me to do a pull-rebase from main and > then make my pull request? I used git at work everyday but I'm still a newbie in many ways. Reading this now but I'm confused because it seems too

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Ryan Joseph via fpc-pascal
at compile time. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Macro expanding error

2022-01-25 Thread Ryan Joseph via fpc-pascal
I have this macro: {$define TCallback := TCallback2} which gives a long list of these errors. warning: Expanding of macros exceeds a depth of 16. What does this warning mean and how can I resolve it? Regards, Ryan Joseph ___ fpc-pascal

<    7   8   9   10   11   12