Re: [fpc-pascal] Bit manipulation helpers

2022-02-21 Thread Ryan Joseph via fpc-pascal
of bit 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

Re: [fpc-pascal] Bit manipulation helpers

2022-02-21 Thread Ryan Joseph via fpc-pascal
flags := 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

[fpc-pascal] Bit manipulation helpers

2022-02-21 Thread Ryan Joseph via fpc-pascal
like 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] 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 ___ fp

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
tanding of 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] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
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

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Ryan Joseph via fpc-pascal
ing a 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

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
nism in 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
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
t means "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-14 Thread Ryan Joseph via fpc-pascal
'm curious 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
DoThis(@MyNestedAction); // error: 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] 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,

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 (a

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

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

2022-01-31 Thread Ryan Joseph via fpc-pascal
en calls out 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

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

2022-01-30 Thread Ryan Joseph via fpc-pascal
/start 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] 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

[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

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 cre

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

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

2022-01-19 Thread Ryan Joseph via fpc-pascal
t: 'git pull ...') 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 ___

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

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

2022-01-19 Thread Ryan Joseph via fpc-pascal
eed me to 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-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 an

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

2022-01-18 Thread Ryan Joseph via fpc-pascal
t it would 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-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-16 Thread Ryan Joseph via fpc-pascal
native ( I would need 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-16 Thread Ryan Joseph via fpc-pascal
constant at compile time. 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
> 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 un

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

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

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

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

2022-01-16 Thread Ryan Joseph via fpc-pascal
don'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-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-15 Thread Ryan Joseph via fpc-pascal
writeln('TInterfacedObject'); There 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-14 Thread Ryan Joseph via fpc-pascal
tch which would 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
ulPul: TPulPul(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] FPC and WebAssembly

2021-12-24 Thread Ryan Joseph via fpc-pascal
enough? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Named optional arguments

2021-12-01 Thread Ryan Joseph via fpc-pascal
btw kind of off topic did you like 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] Named optional arguments

2021-11-28 Thread Ryan Joseph via fpc-pascal
l to allow arbitrary parameter order? I don't recall ever wanting this and would open the door to some functions being called in different order across a codebase, which sounds like a big problem unto itself (C# allows this btw). Regards, Ryan Joseph ___

Re: [fpc-pascal] Named optional arguments

2021-11-28 Thread Ryan Joseph via fpc-pascal
calls. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Named optional arguments

2021-11-27 Thread Ryan Joseph via fpc-pascal
x27;s still really hard to read. My only thought there was that it would open the door for some syntax coloring on the parameter name so you can scan them easier. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.

Re: [fpc-pascal] Named optional arguments

2021-11-27 Thread Ryan Joseph via fpc-pascal
different names, i.e.: procedure Foo(Arg1: String = ''); procedure Foo(Arg2: String = ''); and that would be a big change to the language and have all sorts of implications. So it's really just a minor hint to make the call more readable in the case of long

Re: [fpc-pascal] Named optional arguments

2021-11-26 Thread Ryan Joseph via fpc-pascal
> On Nov 26, 2021, at 4:20 PM, Ryan Joseph wrote: > > It's mainly useful when reading code so you don't need to review the function > definition, using code tools or any other method. I've been enjoying it in > other languages when it's not compulsory

Re: [fpc-pascal] Named optional arguments

2021-11-26 Thread Ryan Joseph via fpc-pascal
l when reading code so you don't need to review the function definition, using code tools or any other method. I've been enjoying it in other languages when it's not compulsory and FPC already supports the syntax so I thought it would be low han

[fpc-pascal] Named optional arguments

2021-11-25 Thread Ryan Joseph via fpc-pascal
led with a mode switch? - Parameters can be specified in any order? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Inline function parameters

2021-11-10 Thread Ryan Joseph via fpc-pascal
tion isn't inlined then > there won't be any change and the passed in function variable will be called > as usual. I mean in theory if the compiler were to support inlining function pointers that is how it could be done. Regards, Ryan Joseph

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

Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Ryan Joseph via fpc-pascal
= aArr[i] * 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] Inline function parameters

2021-11-07 Thread Ryan Joseph via fpc-pascal
heoretically 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

[fpc-pascal] Inline function parameters

2021-11-06 Thread Ryan Joseph via fpc-pascal
ake it 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] First Version Vector Toolkit in OpenGL

2021-11-06 Thread Ryan Joseph via fpc-pascal
ntialiased 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

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

2021-11-05 Thread Ryan Joseph via fpc-pascal
a "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-02 Thread Ryan Joseph via fpc-pascal
slicing up tons of old screenshots and packing them into texture atlases then pushing them into a sprite batcher. I wonder if making a bitmap context backend when have been easier. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@li

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

2021-10-31 Thread Ryan Joseph via fpc-pascal
blem of a composition 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

Re: [fpc-pascal] String error on Windows

2021-10-30 Thread Ryan Joseph via fpc-pascal
; or something but either way I don't see why Windows would disable them. They're all over my program which runs on macOS and I don't want to remove them (like that operator myself). Regards, Ryan Joseph ___ fpc-pascal maillist -

Re: [fpc-pascal] Lazbuild error on Windows

2021-10-30 Thread Ryan Joseph via fpc-pascal
it explicitly myself and triggered the error but at least then I would know it was because of something I did. 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
rus via 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\

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

2021-10-28 Thread Ryan Joseph via fpc-pascal
than 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
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.

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

2021-10-28 Thread Ryan Joseph via fpc-pascal
n try to meet on a Discord channel. > Just seeing this now but this looks pretty useful. I once made a Pascal wrapper for Box2D but this looks like a better more complete solution. Do you have the Pascal unit for Chipmunk2D where we can download and try it? Regards

[fpc-pascal] Lazbuild error on Windows

2021-10-28 Thread Ryan Joseph via fpc-pascal
0: stopped with exit code 1 Error: (lazarus) [TLazPackageGraph.CompileRequiredPackages] "Exit code 1" Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Better way to handle callback types

2021-08-21 Thread Ryan Joseph via fpc-pascal
function a like a catch-all procedural type. > > When Sven is done with the anonymous methods, you'll see it in action. But isn't this going to make the interface wrapper and allocate a class? Maybe Sven can explain how that works. Regards, Ryan Joseph __

Re: [fpc-pascal] Better way to handle callback types

2021-08-21 Thread Ryan Joseph via fpc-pascal
> On Aug 21, 2021, at 1:30 PM, Michael Van Canneyt > wrote: > > "Reference to" can be used for the others as well. How do you mean? Reference to is currently only available for cblocks on macOS I think so I'm not sure how this would look. R

Re: [fpc-pascal] Better way to handle callback types

2021-08-21 Thread Ryan Joseph via fpc-pascal
o write a single function which takes a callback and then have the compiler figure out which type is provided on the caller side. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Better way to handle callback types

2021-08-21 Thread Ryan Joseph via fpc-pascal
end; ... procedure TSList.Sort(callback: TComparator.TFuncProc; context: pointer); var comparator: TComparator; begin comparator.proc := callback; comparator.index := TFuncType.IsProc; { do sorting and call comparator.Call(left, right, context); which routes to the correct callback } end

Re: [fpc-pascal] TProcess read buffer size

2021-07-16 Thread Ryan Joseph via fpc-pascal
takes about 7 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

Re: [fpc-pascal] TProcess read buffer size

2021-07-15 Thread Ryan Joseph via fpc-pascal
2 limit 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.freepa

[fpc-pascal] TProcess read buffer size

2021-07-15 Thread Ryan Joseph via fpc-pascal
512 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] How does FPC perform in the FASTEST Computer Language Race

2021-07-10 Thread Ryan Joseph via fpc-pascal
d on from the idea but I thought it was pretty interesting. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How does FPC perform in the FASTEST Computer Language Race

2021-07-10 Thread Ryan Joseph via fpc-pascal
> On Jul 9, 2021, at 4:56 PM, Ryan Joseph wrote: > >> Current standings at the time of this video >> Iterations per sec: >> Ada: 67 >> Pascal: 143 >> Fastest language: 7301 >> Slowest language: 1 > > So Pascal failed pretty bad it looks like.

Re: [fpc-pascal] How does FPC perform in the FASTEST Computer Language Race

2021-07-10 Thread Ryan Joseph via fpc-pascal
v[argc - 1]), (uint64_t)1); assert(upperLimit < Sieve::maxSize); } auto checkSieve = Sieve(upperLimit); checkSieve.runSieve(); const auto result = validateResults(checkSieve) ? checkSieve.count() : 0; const auto numberOfThreads = thread::hard

Re: [fpc-pascal] How does FPC perform in the FASTEST Computer Language Race

2021-07-09 Thread Ryan Joseph via fpc-pascal
> On Jul 9, 2021, at 11:40 AM, Wayne Sherman via fpc-pascal > wrote: > > Current standings at the time of this video > Iterations per sec: > Ada: 67 > Pascal: 143 > Fastest language: 7301 > Slowest language: 1 So Pascal failed pretty bad it looks like. ;) R

[fpc-pascal] Tuples as variant arrays

2021-06-25 Thread Ryan Joseph via fpc-pascal
; i: variant; begin t := [1,'string', r]; for i in t do begin writeln(i); end; 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] Management operators memleaks

2021-06-14 Thread Ryan Joseph via fpc-pascal
t bug report so I'm not sure. Most importantly Denis needs to isolate this into a small single program which prints out the operators like in the bug report Sven listed. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@l

Re: [fpc-pascal] Management operators memleaks

2021-06-13 Thread Ryan Joseph via fpc-pascal
l to knowing what may be wrong. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Option type

2021-06-01 Thread Ryan Joseph via fpc-pascal
> On Jun 1, 2021, at 5:05 PM, Henry Vermaak wrote: > > https://en.wikipedia.org/wiki/Option_type Yeah just use Nullable then since it sounds like that's the closest we're going to get in FPC. Regards, Ryan Joseph ___

Re: [fpc-pascal] Option type

2021-06-01 Thread Ryan Joseph via fpc-pascal
that requires a variant record? I don't know what "TOption" is. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Option type

2021-06-01 Thread Ryan Joseph via fpc-pascal
o use a constraint like: type generic TOption = record case IsSome:boolean of true: ( some: T ); false: (); end; Not sure why though. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.free

Re: [fpc-pascal] 50 years of Pascal, by the the author himself

2021-05-12 Thread Ryan Joseph via fpc-pascal
> On May 12, 2021, at 4:00 PM, Sven Barth wrote: > > There's also Oxygene as one of the current ones. > Oh that's right, that's a pretty cool one. I hope once closures are finished we can use them to implement async/await like Oxygene or JavaScript. :) R

Re: [fpc-pascal] 50 years of Pascal, by the the author himself

2021-05-12 Thread Ryan Joseph via fpc-pascal
al compilers left? I used THINK Pascal and Metrowerks Pascal in the distant past but those are all long dead. You can't really talk about Pascal in 2021 without mentioning those 2 compilers. Regards, Ryan Joseph ___ fpc-pasca

Re: [fpc-pascal] Array range overflow in properties

2021-04-30 Thread Ryan Joseph via fpc-pascal
> On Apr 29, 2021, at 11:22 PM, Sven Barth wrote: > > Well, there should *at least* be a warning and an error if range checks are > enabled... Please file a bug report. https://bugs.freepascal.org/view.php?id=38829 Regards,

[fpc-pascal] Array range overflow in properties

2021-04-29 Thread Ryan Joseph via fpc-pascal
Is this a bug in properties and I should be getting an error? type TPixel = record components: array[0..3] of byte; property R: byte read components[10] write components[10]; end; Regards, Ryan Joseph

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-29 Thread Ryan Joseph via fpc-pascal
nstructs. > Great, that's what I wanted to do. It's well worth the time to get anon functions for callbacks that return immediately, list.ForEach, list.Sort etc 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-devel] Nested function closures

2021-04-28 Thread Ryan Joseph via fpc-pascal
ng none of this and for good reason. This feature has been collecting dust as "almost done" for years now so I would consider ourselves lucky to get anything at all. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Ryan Joseph via fpc-pascal
ave 2 kinds of closures but only one of those is compatible with anonymous functions and this is why I want the other closures (nested functions) to have the same pair of functionality. 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-devel] Nested function closures

2021-04-27 Thread Ryan Joseph via fpc-pascal
end > ); I agree it's verbose but the syntax is already decided upon and implemented already. 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-devel] Nested function closures

2021-04-27 Thread Ryan Joseph via fpc-pascal
> On Apr 27, 2021, at 2:23 PM, Ryan Joseph wrote: > > But why would it do that when we could use an alternate code path that uses > nested functions instead? Maybe I'm not being clear but we can do BOTH > depending the situation when one is better than the ot

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-27 Thread Ryan Joseph via fpc-pascal
ng clear but we can do BOTH depending the situation when one is better than the other. This is just an optimization that leverages existing features that are already in the compiler anyways. Seems like a no-brainer to me. Regards, Ryan Joseph _

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-27 Thread Ryan Joseph via fpc-pascal
e based because there are not enough real world use cases to support any alternative. Which is contrary to what you're saying that nested functions/closure will be compatible types. Sven can clear this up for us I guess. Regards, Ryan Joseph ___

Re: [fpc-pascal] How does TFPGMap key compare work?

2021-04-20 Thread Ryan Joseph via fpc-pascal
ings? function TFPGMap.KeyCompare(Key1, Key2: Pointer): Integer; begin if PKey(Key1)^ < PKey(Key2)^ then Result := -1 else if PKey(Key1)^ > PKey(Key2)^ then Result := 1 else Result := 0; end; Regards, Ryan Joseph ___ f

[fpc-pascal] How does TFPGMap key compare work?

2021-04-19 Thread Ryan Joseph via fpc-pascal
^, Key2^, FKeySize); 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] Abstract classes ignored

2021-04-19 Thread Ryan Joseph via fpc-pascal
> On Apr 18, 2021, at 11:28 PM, Sven Barth wrote: > > Nowadays: backwards compatibility. backwards compatibility strikes again. :) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.

Re: [fpc-pascal] Abstract classes ignored

2021-04-18 Thread Ryan Joseph via fpc-pascal
> On Apr 18, 2021, at 5:00 AM, Sven Barth wrote: > > As I have said: Delphi compatibility. This would have been a good candidate to put behind the delphi mode switch but I'm sure there is a reason for this also. Regards,

Re: [fpc-pascal] Abstract classes ignored

2021-04-17 Thread Ryan Joseph via fpc-pascal
t in the first place? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

  1   2   3   4   5   6   7   8   9   10   >